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

OAuth consent screen not redirecting to default current page #30

Open
setyoaji21 opened this issue Oct 22, 2018 · 5 comments
Open

OAuth consent screen not redirecting to default current page #30

setyoaji21 opened this issue Oct 22, 2018 · 5 comments

Comments

@setyoaji21
Copy link

I have successfully redirecting user to google oauth consent screen. But, after the access granted it won't return to default current page

@samtgarson
Copy link
Contributor

Will need a lot more information than this to be able to help.

@cedricium
Copy link

In many OAuth authentication libraries, they provide you (the developer) the option to set the redirect uri which is the uri that the OAuth provider (i.e. Google, Twitter, Reddit, etc.) will redirect back to in the case that the user consents to having their account used.

nuxt-oauth does not provide the option to set the redirect uri and after some digging, it seems that the uri is set to ${protocol}://${this.req.headers.host}/auth/callback. I'm using this to authenticate with reddit so YMMV, but I successfully redirect the user to reddit's oauth consent screen, however, after "Allow" is clicked, reddit tries to redirect to http://localhost:3000/auth/callback. This is where the issue occurs - if you manually go to http://localhost:3000/auth/callback, my Nuxt app redirects to reddit's oauth consent screen - ultimately the user will not be able to get back to my Nuxt app after consenting since the redirect uri that is used by nuxt-oauth also redirects to the oauth provider.

I assume this is the same issue @setyoaji21 is seeing. Hopefully this makes sense and we can get this worked out.

@samtgarson
Copy link
Contributor

samtgarson commented Feb 15, 2019

@cedricium why does Reddit not successfully redirect you back to your callback URL?

The reason you get bounced out again when you hit it manually is that you don't have the required URL params that the OAuth provider should include when redirecting you back.

I would check what URL Reddit is redirecting you back to. It should be your callback URL with some URL params including token and some others.

@iiAbady
Copy link

iiAbady commented May 7, 2019

this actually happend to me when I return a huge data on fetchUser hook.

@samtgarson
Copy link
Contributor

@Abady321x123 could you provide some more detail? I'm not sure it's the same issue if it's happening during the fetchUser hook as that means the app has successfully authenticated initially.

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

4 participants