st4lk / django-rest-social-auth

OAuth signin with django rest framework
MIT License
522 stars 122 forks source link

User not created when posting the code at jwt_pair endpoint #125

Open OdifYltsaeb opened 4 years ago

OdifYltsaeb commented 4 years ago

Hi!

from here: https://github.com/st4lk/django-rest-social-auth#oauth-20-workflow-with-rest-social-auth anybody can read that "Backend will either sign in the user, either signup, either return an error."

I always took it that it means 1) if user exists, sign in, 2) if not, sign up, 3), something goes wrong, return an error.

But with empty database user is not created for whatever reason. and instead the response is: {"detail":"User not found","code":"user_not_found"}

OdifYltsaeb commented 4 years ago

Why is it important to specify authenticators as [JWTAuthentication()] in SimpleJWTAuthMixin ? Why does the view, that returns token and refresh token pair need authentication anyway?

As far as I know, that's what stopping user being created during the request in backends pipeline. When I override this and return [] in this method, then everything seems to work fine (seems because I actually have not tested it fully)

ajaiau0 commented 3 years ago

in every request, it appear { "detail": "User not found", "code": "user_not_found" }

abu-sayem commented 2 years ago

@ajaiau0 Have you got any solution?