mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 00:56:34 +03:00
Return login data from SocialLoginSerializer.validate for views to use
This commit is contained in:
parent
624ad01afb
commit
f51ebbeffd
|
@ -142,6 +142,10 @@ class SocialLoginSerializer(serializers.Serializer):
|
|||
login.lookup()
|
||||
login.save(request, connect=True)
|
||||
|
||||
# we return the login data (and so User and SocialAccount instances) here
|
||||
# such that custom login and connect views can render suitable responses
|
||||
attrs['login'] = login
|
||||
# we still return `user` here for backwards compatibility
|
||||
attrs['user'] = login.account.user
|
||||
|
||||
return attrs
|
||||
|
|
Loading…
Reference in New Issue
Block a user