Closed cambridgemike closed 10 years ago
It's already like that, you can define SOCIAL_AUTH_FACEBOOK_LOGIN_REDIRECT_URL
Oh, that's awesome. It wasn't in the documentation. Thanks a bunch!
@omab Is it possible to set this redirect_url from within the pipeline?
@cambridgemike, you can set the next
value in the session, like this:
strategy.session.set('next', '/your/url')
But this is a workaround.
Thanks, that's good enough for me!
@omab will this work? The redirect_value
is grabbed from the session before the pipeline finishes running
redirect_value = backend.strategy.session_get(redirect_name, '') or \
data.get(redirect_name, '')
is_authenticated = user_is_authenticated(user)
user = is_authenticated and user or None
partial = partial_pipeline_data(backend, user, *args, **kwargs)
if partial:
xargs, xkwargs = partial
user = backend.continue_pipeline(*xargs, **xkwargs)
else:
Right, my suggestion to change it in the pipeline won't work at all. What are you trying to accomplish? Maybe there's another way.
I want to send a user to /facebook/login?redict_after=/my/url
OR /facebook/complete?redirect_after=/my/url
. And have them redirected to /my/url
after authenticated
Do I just need to put next=/my/url
I assumed next
was used for internal state tracking
@cambridgemike, yes, that's all you need, just add next=/my/url
to the login/signup URL. Docs about that is located here http://psa.matiasaguirre.net/docs/use_cases.html?highlight=next#return-the-user-to-the-original-page.
Is it possible to turn off SANITIZE_REDIRECTS for the django strategy without writing my own strategy?
Set SOCIAL_AUTH_SANITIZE_REDIRECTS = False
awesome aswesome, I see that's in the docs as well... sorry about that.
Thanks for everything!
It would be great if the backend could define its own LOGIN_REDIRECT_URL.
Thanks!