garyburgmann / drf-firebase-auth

Firebase backend to receive a user idToken and authenticate via Django REST Framework 'authentication.BaseAuthentication'. Optionally, a new local user can be created in the process.
MIT License
127 stars 61 forks source link

_get_or_create_local_user - User.DoesNotExist: or detail": "duplicate key value violates unique constraint \"users_customuser_username_key\"\nDETAIL: Key (username)=(...) already exists #44

Open dejavvu opened 1 year ago

dejavvu commented 1 year ago

Hi

I don't know if this is related to drf-firebase-auth but I believe there is something I'm missing here. I'm developing a flutter app with a Django backend. After users sign in I send a request to REST APi and pull the necessary data.

This error happens on initial signup, after restarting the app, no error shows up. After the initial signup Server returns 403. If I check the logs I found these 2 errors.

I believe something happens when the local user is being created but I couldn't really find a solution. I caught these using Sentry and Apilogs

I'm also using default drf-firebase-auth settings.

Thank you for your time.