iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.63k stars 304 forks source link

Apple login creates no username/profile in production #505

Open viktorisacenko opened 1 year ago

viktorisacenko commented 1 year ago

In production i'm facing an issue with the apple login. After getting the auth code successfully from the apple i'm sending it to the django backend with a custom adapter for creating a profile after user creation.

class SocialAccountAdapter(DefaultSocialAccountAdapter):
    def save_user(self, request, sociallogin, form=None):
        user = super().save_user(request, sociallogin, form)

        profile = Profile.objects.get_or_create(user=user)
        return user

and in settings:

SOCIALACCOUNT_ADAPTER = 'core.adapters.SocialAccountAdapter'

On the local machine it works perfectly, but in production it creates the user but without a username and the creation of the Profile also dont work.

I am really slowly at a loss and would appreciate any help