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

Anyway to return the URL of the provider login page (with params) vs. forcing a redirect? #362

Open
bustardo opened this issue May 7, 2021 · 1 comment

Comments

@bustardo
Copy link

bustardo commented May 7, 2021

Hi,
Instead of this behavior:

if provider.authorized:
     return { "message" : "success"}, 200
else:
    return redirect(url_for(provider.login))

I'd like to do something like this:

if provider.authorized:
     return { "message" : "success"}, 200
else:
    return  { "message" : "must login to provider", "url" : parameterized_url }, 200

Is there a way to do this that I'm missing?

I know that I can get the URL I'm looking for using the
@oauth_before_login.connect decorator ,
but I still get redirected, so it really does me no good. Is there another way to get that specific url?

The end result I'm going for would open up the parameterized_url via the front end in a new window, so they could login with the provider.
Any help would be greatly appreciated as I love using flask-dance!

@bustardo
Copy link
Author

I ended up abandoning this approach and retrieved the token and passed it to my backend. Working great so far!

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