There's not a direct way to do it, the quick solution that comes to my
mind is:
1. Add a parameter to differentiate the actions, use "/login/facebook"
for login and "/login/facebook?signup=1" for signup.
2. Define this setting:
SOCIAL_AUTH_FIELDS_STORED_IN_SESSION = ['signup']
This setting tells the app to store the query parameter "signup" in
the session (if it's present).
3. Override "create_user" pipeline with this (not tested) version:
from social.pipeline.user import create_user
def custom_create_user(strategy, user=None, *args, **kwargs):
if user is None: # no user discovered
if strategy.session_get('signup'):
# user clicked the "signup" button
return create_user(strategy, user, *args, **kwargs)
else:
# user clicked the "login" button but the account wasn't
# registered (yet)
return redirect('/')
else:
return {'is_new': False}
Makes sense?
Matías
--
Matías Aguirre
http://matiasaguirre.net/