-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
signInWithRedirect sometimes does not forward to the auth provider #13751
Comments
Hello, @ronbhomri and thanks for opening this issue. It sounds like you are calling the |
@cwomack thank you for the quick answer!
|
I see inside
so from what you saying, I expect to get this error in this line: |
Hello @ronbhomri. The The The reason it happens randomly is that the To make sure your users can login again after |
@israx something is still not clear to me. |
@israx if you can also clarify what is the common approach for using |
Hello @ronbhomri. Could you share some code snippets of the following,
To answer your other question, a common approach of
For other cases where global revocation is needed, you are better off using the |
@israx I meant what is the common approach of dealing it on the FE side. |
Hello @ronbhomri. A common approach to use Regarding the other question, I'm trying to understanding the failure scenario with
|
@israx thank for replying. I will explain how the error usually looks like:
Replaying to your questions:
I will say that it usually work for the second time. |
@ronbhomri, can you clarify what the URL is that users are being sent to when attempting to call |
Hello @ronbhomri. In addition to @cwomack comment, I think the issue lies in how your App updates state. You can use conditional rendering to update the Before
After
|
Hi @cwomack @israx, Now I have another question regarding hub.listen. In the Amplify docs there is an example to use it like this:
I've notice we have race condition here on login, since it calls the last
Is using |
@ronbhomri, it does seem like one valid solution at this point would be to wrap your I believe the original scope of this issue was resolved tied to the |
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue. Thank you! |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
CDK
Environment information
Describe the bug
Sometimes, totally random, when a user tries to login via
signInWithRedirect
with a custom provider, it seems the function get called, but the user is not redirected to the provider and therefore no user is in the session. There is not a clear pattern here, but it is only happens to users we useadminGlobalSignOut
in the cdk (in the backend) to log them out of our app and revoke all of the tokens. We do it for the users after an hour if the user is not active in the app.Expected behavior
Always redirect the user to the auth provider or throw a relevant error.
Reproduction steps
I can't reproduce as it is random, but I think it has a link to the Admin global sign out, so I would start there.
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: