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

Provide state object when handling errors in handleCallback #586

Closed
alexghr opened this issue Feb 2, 2022 · 3 comments · Fixed by #625
Closed

Provide state object when handling errors in handleCallback #586

alexghr opened this issue Feb 2, 2022 · 3 comments · Fixed by #625
Labels
enhancement New feature or request

Comments

@alexghr
Copy link

alexghr commented Feb 2, 2022

Describe the problem you'd like to have solved

I can't access the login state (as generated by getLoginState in the login handler) when handling OAuth errors (e.g. error=access_denied) in the callback handler.

Describe the ideal solution

Ideally the state object that I set in the login handler should be available when the callback handler deals with an OAuth error.

Alternatives and current work-arounds

The Auth0 service returns the state parameter back in the URL (as per spec). I could read this parameter but since my app does not control serializing the state (it's this lib's concern) into the authorization request, I can't make any assumptions about how the state is encoded. FWIW it looks to be a base64 string of the JSON object I'm after.

Additional information, if any

Would be nice to have access to the state we set on login so that I might have a better idea of what the user was trying to achieve before trying to login 😄

@alexghr alexghr changed the title Provide state object when handling errors in callbackHandler Provide state object when handling errors in handleCallback Feb 2, 2022
@adamjmcgrath adamjmcgrath added the enhancement New feature or request label Feb 3, 2022
@adamjmcgrath
Copy link
Contributor

Thanks for sharing this use case with us @alexghr

I'll prioritise this with the team, I'm not sure when we'll be able to get to it, but I'll update this thread when I have any news.

@alexmalev
Copy link
Contributor

@adamjmcgrath it seems that the additional props are stripped when HandlerError is called,
since it strips down all the useful info before the error is returned to the application

@adamjmcgrath
Copy link
Contributor

Thanks for raising this @alexmalev - this has been fixed in the soon to be released v2 by #782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants