I'm using django 1.8.3 and django-allauth 0.21.0 and I'd like the user to be able to log in using e.g. their Google account without leaving the page. The reason is that there's some valuable data from the page they're logging in from that needs to be posted after they've logged in. I've already got this working fine using local account creation, but I'm having trouble with social because many of the social networks direct the user away to a separate page to ask for permissions, etc. Ideally, I'd have all this happening in a modal on my page, which gets closed once authentication is successful.
The only possible (though not ideal) solution I can think of at the moment is to force the authentication page to open up in another tab (e.g. using target="_blank" in the link), then prompting the user to click on something back in the original window once the authentication is completed in the other tab.
However, the problem here is that I can't think of a way for the original page to know which account was just created by the previously-anonymous user without having them refresh the page, which would cause the important data that needs to be posted to be lost.
Does anyone have any ideas about how I could accomplish either of the two solutions I've outlined above?