Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to replicate RegisterSerializer.custom_signup for social signups #592

Open
trackers153 opened this issue Feb 12, 2024 · 0 comments
Open

Comments

@trackers153
Copy link

Hi - I have posted this question here but am wondering if this might be the better forum for it.

I have overridden RegisterSerializer.custom_signup (REGISTER_SERIALIZER) to set certain parameters in the user's profile based on cookie values and it works fine when a user registers using email/password. However, what I realized was that it's not getting called when the user registers through social (Google, specifically).

I found SocialLoginSerializer.post_signup which sounds like it might be the right place to inject similar logic, but I am not sure how to tell dj_rest_auth to use the overridden class. There does not appear to be an equivalent to the REGISTER_SERIALIZER config variable that points to the new class.

I also considered moving this logic to User's post_save signal event, but unfortunately one can't access the request (and cookies) from there (without some middleware acrobatics).

I am using dj_rest_auth 4.0.1 and allauth 0.50.0

Thanks in advance for any pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant