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

getRedirectResult(auth) still returns a UserCredential with a NONnull user after signing in or signing out (no redirect operation was called) #5610

Closed
koroman17 opened this issue Oct 14, 2021 · 5 comments · Fixed by #5617
Assignees

Comments

@koroman17
Copy link

koroman17 commented Oct 14, 2021

First I sign in

const provider = new GoogleAuthProvider();
signInWithRedirect(auth, provider);

then I get a UserCredential with a NONnull user (of course)

const handleGetRedirectResult = async () => {
	try {
		const result = await getRedirectResult(auth);
		console.log(result);
	} catch (error) {
		console.log(error);
	}
};
handleGetRedirectResult()

then I run the same function again

handleGetRedirectResult()

I still get a UserCredential with a NONnull user @@

then I sign out

signOut(auth)

then I run the function again

handleGetRedirectResult()

I still get a UserCredential with a NONnull user again @@
I think firebase has saved the redirect data somewhere and hasn't deleted it after first getRedirectResult(auth) that when I run handleGetRedirectResult() again, it still returns a UserCredential with a NONnull user even that I have signed out

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@jbalidiong
Copy link
Contributor

Hi @koroman17, thanks for the report. I was able to reproduce the behavior now. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share.

@JGSolutions
Copy link

still getting null with 9.2.0 version

@sam-gc
Copy link
Contributor

sam-gc commented Nov 1, 2021

@JGSolutions, do you mean getting nonnull? The PR linked above (#5617) makes it so that it will return null on subsequent calls (as is expected)

@JGSolutions
Copy link

Yes! In version 8 was getting user and credientials objects with properties. And now they are null. If that is expected then not sure why but broke my login process

@firebase firebase locked and limited conversation to collaborators Nov 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants