I'm having a really odd issue that I'm having trouble figuring out.
On my site, I have an option for a user to register via either a normal signup page or via Facebook social auth --I'm using the Social Auth App for Python/Django.
A user can successfully register either way.
If a user registers by the normal signup method and enters username and email and password---they are able to successfully trigger a password reset if desired via a password reset page.
BUT, if a user signs up via Facebook AUTH, after their user profile is created, if they go to enter their email for a password reset, no EMAIL is generated.
Here are my settings in settings.py for the auth apps.
AUTH_USER_MODEL = "accounts.User"
SOCIAL_AUTH_USER_MODEL = 'accounts.User'
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {
'fields': 'id,name,email',
}
SOCIAL_AUTH_SLUGIFY_USERNAMES = True
SOCIAL_AUTH_PIPELINE = (
'social_core.pipeline.social_auth.social_details',
'social_core.pipeline.social_auth.social_uid',
'social_core.pipeline.social_auth.auth_allowed',
'social_core.pipeline.social_auth.social_user',
'social_core.pipeline.user.get_username',
'social_core.pipeline.social_auth.associate_by_email', # <--- enable this one
'social_core.pipeline.user.create_user',
'social_core.pipeline.social_auth.associate_user',
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
)
As you can see i'm slugifying the username, so all fields are populated.
Here is my User model
class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(unique=True, error_messages={'unique':"This email has already been registered."})
username = models.CharField(max_length=40, default='')
first_name = models.CharField(max_length=40, default='', blank=True)
last_name = models.CharField(max_length=40, default='', blank=True)
date_joined = models.DateTimeField(default=timezone.now)
favorites = models.ManyToManyField(Deal, related_name='favorited_by', null=True, blank=True)
is_active = models.BooleanField(default=True)
is_staff = models.BooleanField(default=False)
objects = UserManager()
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['username']
Anyone see anything that I might be missing here--or why these emails might not be triggered?