-
Notifications
You must be signed in to change notification settings - Fork 269
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
loginWithPopup close doesn't return any error response #821
Comments
Got redirected here from the issue I raised in auth0-spa-js repo: auth0/auth0-spa-js#1334 |
Same behavior on Firefox too. |
Hey @JeremyLiang0105 A crude example: const myComponent = () => {
const { error, isLoading, isAuthenticated } = useAuth0();
if (error) {
return <div>There was an error while authenticating: {error}</div>;
}
// ...
} See https://github.com/auth0/auth0-react/blob/main/examples/cra-react-router/src/App.tsx for another example. See here how the error from |
Thank you for this, we have identified the root cause and we will make a minor release shortly along with other features. |
Hey @JeremyLiang0105 , @nicosabena is correct. You can determine if the popup was closed by checking the error property from Example:
And since you mentioned you're not using the latest version of |
Closing as a resolution has been found. |
Checklist
Description
We are using loginwithpopup (Auth0's sdk link) to open the Auth0's universal login MFA enrollment prompt in a popup window. The issue we are encountering is we cannot find a way to handle if the user closes/cancels the popup page. The expected behavior is that when the user closes the popup, it should return us an error to indicate it so we could catch it and display an error on our app to instruct the user to click the button to open the popup again. We've tried the solutions from auth0/auth0-spa-js#599 but it doesn't work because we don't receive any error response. The happy path works fine
This is the code we use
No error is being thrown when the user closes the popup without completing the steps.
The version of auth0-react we are using is "@auth0/auth0-react": "1.12.1"
Reproduction
Code snippet copied above.
Additional context
No response
auth0-react version
1.12.1
React version
18
Which browsers have you tested in?
Chrome
The text was updated successfully, but these errors were encountered: