Tivix / django-rest-auth

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
www.tivix.com
MIT License
2.41k stars 661 forks source link

Return login data from SocialLoginSerializer.validate for views to use #566

Open lukeburden opened 5 years ago

lukeburden commented 5 years ago

I needed to customize SocialConnectView, such that in its response it renders the SocialAccount newly created or updated. Since this library persists the new SocialAccount instance in the call to SocialLoginSerializer.validate, this meant returning the social login in the validated attributes, such that a custom connect view could then render the new account using SocialAccountSerializer.

This is a small change allowing that kind of flexibility.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.004%) to 96.048% when pulling f51ebbeffd110cb9c1efe3f1cf590cbffac2f2d6 on livebungalow:return-login-data-from-validate into 624ad01afbc86fa15b4e652406f3bdcd01f36e00 on Tivix:master.

BarnabasSzabolcs commented 4 years ago

Hi, as a user of rest-auth, thanks for the contribution! This repo is not maintained anymore, so the development moved to dj-rest-auth. (reference: https://github.com/Tivix/django-rest-auth/issues/568) It may be best, if you move this PR there. (and upgrade to using dj_rest_auth)

new repo link: https://github.com/jazzband/dj-rest-auth (I'm not the upkeeper of that repo, it just makes sense for me to help you merge your PR)

Many Thanks, Barney