You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to using custom model with Djoser JWT endpoint but I want to reset the password for those user who register with Google OAuth.
When I am using the API endpoint the password reset mail is not getting send to mail.
Any suggestion is appreciated.
The text was updated successfully, but these errors were encountered:
i have same very similar,
Google login works, it's create correctly user and also JWT token can be created ,
but when i try to reset password through send email, response says ["User with given email does not exist."]
note. if account is created with user_create by djoser they can reset password w/o problems
just saw around
seem the problem is the missing password and amost all guides online points to one wrong solution to use djoser
to avoid that problem just add a random pass when is None
`class UserManager(BaseUserManager):
def create_user(self, email, password=None, **kwargs):
if not email:
raise ValueError("Users must have an email address")
email = self.normalize_email(email)
user = self.model(email=email, **kwargs)
if(password is None):
password = get_random_string(10)
user.set_password(password)
user.is_active = True
user.save()
return user`
Hello,
I am trying to using custom model with Djoser JWT endpoint but I want to reset the password for those user who register with Google OAuth.
When I am using the API endpoint the password reset mail is not getting send to mail.
Any suggestion is appreciated.
The text was updated successfully, but these errors were encountered: