dj-rest-auth icon indicating copy to clipboard operation
dj-rest-auth copied to clipboard

uid Invalid value

Open marcosantar93 opened this issue 4 years ago • 17 comments

Hi! It seems like the last PR https://github.com/iMerica/dj-rest-auth/pull/266 broke the /dj-rest-auth/password/reset/confirm/ endpoint. If I use the last version of the package with the uid and token on the url which arrives on my email after creating the password reset request, I get

{
    "uid": [
        "Invalid value"
    ]
}

However, after commenting out the include from allauth in dj_rest_auth/serializers.py and using urlsafe_base64_decode instead, the password is successfully changed

Here is the relevant line on my urls.py file

path('password/reset/confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),

I'm fairly new to django and I just started using this package, so the error may be on my side.

marcosantar93 avatar Jun 14 '21 16:06 marcosantar93

cc/ @squio

iMerica avatar Jun 16 '21 04:06 iMerica

cc/ @squio

Hmm looks like this PR broke more than it solved, please feel free to undo this merge (I have found a different work around which definitely won't break either dj-rest-auth or allauth: see https://gist.github.com/squio/28aadec528bea9302c168744fd0af3b6 )

squio avatar Jun 16 '21 09:06 squio

I'm seeing a similar issue. Getting errors like the below on version 2.1.7.

{
    "non_field_errors": [
        "“MjJkNjQ4OWUtYjNiMS00MGIxLTgzMDAtMDcxOTAwNzc3YjUy” is not a valid UUID."
    ]
}

Edit: The issue goes away when I downgrade to 2.1.5. Version 2.1.6 still has the issue.

RommelTJ avatar Jun 28 '21 14:06 RommelTJ

@RommelTJ thanks for sharing your tmp solution to downgrade to 2.1.5; you saved me a lot of time!

SebJansen avatar Jun 29 '21 17:06 SebJansen

Please see my pr: https://github.com/iMerica/dj-rest-auth/pull/276

LanceMoe avatar Jun 30 '21 12:06 LanceMoe

On 2.1.9 UID is still invalid & 2.11 didn't work. Downgrading to 2.1.5 worked for me, hoping this gets fixed asap as this effectively makes password reset unusable & wasn't a terribly great experience trying to implement this the first time :(

Tobeyforce avatar Sep 23 '21 20:09 Tobeyforce

@Tobeyforce any luck?

lukehinds avatar Nov 12 '21 20:11 lukehinds

@Tobeyforce any luck?

I believe I ended up staying on 2.11 but instead overriding a serializer or view. I'm not entirely sure, looking at my prod & local dev I'm at 2.11 at least. It could be that the problem was on the allauth side for me. Wish I could help you out more here & wish I had followed up once I got things working. It could also be that there were some things that needed to be adjusted in urls.py.

Things got quite complicated for me as I ended up using social auth as well which means I went back and forth between allauth docs and dj-rest-auth docs to make all things click.

Tobeyforce avatar Nov 25 '21 14:11 Tobeyforce

The same problem happened to me and it gets solved when downgrading to 2.1.5. It is related to the allauth import I think. Is there any solution apart from downgrading or not yet?

mateokurti avatar Aug 24 '22 12:08 mateokurti

@mateokurti Which version of dj-rest-auth are you using? I haven't tried past version 2.1.7, but this MR got merged so perhaps it's worth a try on the latest release?

RommelTJ avatar Aug 24 '22 15:08 RommelTJ

@RommelTJ I was upgrading all dependencies of my project to latest, so I tried the latest version first and it didn't work. Then tried downgrading until 2.1.5 seemed to work.

I actually have it sleightly different. Instead of:

path('password/reset/confirm/<uidb64>/<token>/',

I have:

path('password/reset/confirm/<uid>/<token>/',

Not sure if that has to do with the problem

mateokurti avatar Aug 24 '22 21:08 mateokurti

Also facing the same problem, why isn't this fixed?!

minifisk avatar Sep 06 '23 13:09 minifisk