bhubr / react-simple-oauth2-login

Simple React component for OAuth2 login - Supports Authorization Code and Implicit Grant flows.
MIT License
49 stars 31 forks source link

Redirect URI is not encoded #22

Open tennox opened 3 years ago

tennox commented 3 years ago

When passing a redirectUri http://localhost:3000/#/oauth-callback/discord The pop-up link generated by this lib is: https://discord.com/oauth2/authorize?client_id=X&redirect_uri=http://localhost:3000/#/oauth-callback/discord&response_type=token

Discord will reject the request with the message: "Invalid redirect URI"

If I manually encode the URI and pass it to the React component, it works fine.

bhubr commented 3 years ago

Thanks for pointing out this issue. I've got a bunch of PRs to look into (including yours!) and I'm adding this to my todo-list.

bhubr commented 3 years ago

@all-contributors please add @tennox for bug

allcontributors[bot] commented 3 years ago

@bhubr

I've put up a pull request to add @tennox! :tada: