-
Notifications
You must be signed in to change notification settings - Fork 305
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
All Login Buttons are Frozen on Canceling Social Login #4975
Comments
@pmoghaddam Was not able to immediately replicate the behavior in an example app with |
Version is 6.1.2. @calebpollman attached is my video in action. I'll update the issue to specify that this is iOS safari. Basically though I think on going back, browser's Simulator.Screen.Recording.-.iPhone.15.-.2024-01-24.at.08.40.38.mp4 |
Thanks for the additional details. Will continue looking in to reproduction, in the meantime can you confirm whether using import React from 'react';
import { Amplify } from 'aws-amplify';
import { getCurrentUser, signInWithRedirect, signOut } from 'aws-amplify/auth';
import config from './amplifyconfiguration.json';
Amplify.configure(config);
export default function MyApp() {
const [isSignedIn, setIsSignedIn] = React.useState(false);
React.useEffect(() => {
getCurrentUser()
.then(() => {
setIsSignedIn(true);
})
.catch(() => {
setIsSignedIn(false);
});
}, []);
return isSignedIn ? (
<button
onClick={() => {
signOut();
}}
>
Sign Out
</button>
) : (
<button
onClick={() => {
// 'Google` can be replace with other configured providers
signInWithRedirect({ provider: 'Google' });
}}
>
Sign In
</button>
);
} |
@pmoghaddam Couple follow up questions:
|
I'd have to tweak my environment to make that possible, so it may take me a while, but will aim to do so. Thank you for looking into this! |
Glad someone brought up this issue. I've been experiencing this same issue for months. |
@pmoghaddam Tried to repro the issue by in two apps, one using the code snippet here as well as one with the Going to transfer this over to the Amplify JS team, hoping they can get you unblocked! |
@calebpollman a few points to not forget regarding reproduction:
Perhaps if you create it, using |
hello @pmoghaddam . Are you able to see any keys stored in |
@israx Yes. Basically, from what I can see:
So I suspect the buttons are deactivated if localStorage is setup, and they are not considering that "bfcache" is not causing a rerender. You can probably listen to "pageshow" event to detect when page is viewing again, rather than a re-render. |
got it, yeah so I believe that is the issue. Amplify JS might not be able to detect the cancelation of the follow due to this "bfcache" capability. I'll get in touch with the team and have any follow ups. In the mean time, could please share what localStorage keys are you getting after cancelling the OAuth flow? |
@pmoghaddam if it is possible, could you attach a video showing the OAuth localStorage keys after cancelling your OAuth flow ? |
After further testing, we think we've isolated the root cause and will be working on a fix. Sending this back over to Thank you again @pmoghaddam for creating this and getting us rapid feedback/replies! |
@pmoghaddam Was able to recreate the issue using Firefox and have opened a fix here |
Has this bug regressed? I encounter the bug on Chrome and Safari with Authenticator on latest: |
@alex-breen Can you please install |
@calebpollman Yes, I confirmed the issue remains on
|
Thanks for confirming @alex-breen. Have been unable to repro, could you please open a new issue with a small reproduction? |
@calebpollman - thanks all do that. I notice that it doesn't happen if I host using |
@calebpollman - I created new issue: aws-amplify/amplify-js#13274 |
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Authenticator
How is your app built?
Vite
What browsers are you seeing the problem on?
iOS Safari - however I suspect this happens in all browsers, it's only that iOS Safari doesn't cause a browser refresh which resets the state and avoids this problem.
Please describe your bug.
When using social logins, if the user cancels or goes back, all login buttons (including native login) do not do anything.
The user has to either refresh, or switch tabs, for them to become active again.
What's the expected behaviour?
The buttons should work as usual.
Help us reproduce the bug!
I do not have anything special. If you setup social buttons, click on Sing in with Google/Apple, but cancel and go back, you'll be stuck.
#1660 helped improve the situation since before it'd simply be blank altogether, but now the Authenticator is present, but not functional.
The text was updated successfully, but these errors were encountered: