react-admin-firebase icon indicating copy to clipboard operation
react-admin-firebase copied to clipboard

Issue: signInSuccessWithAuthResult is called and says user logged in, but authProvider says no user logged in.

Open rjjan opened this issue 2 years ago • 1 comments

Hi, In my login page, I use StyledFirebaseAuth and "sign in with google"

uiConfig.signInFlow = "redirect" callbacks signInSuccessWithAuthResult (authResult, redirectUrl) => { if (authResult.user) { // i explicitly redirect to my specific page /foo navigate("/foo"); // navigate = useNavigate(); } return false; }

But after i explicitly redirec to foo page, in foo page, the authProvider seems not "detect" user has logged in, so the upper right user avatar is still the "not logged in" status

Also authProvider.getIdentity() get null.

My question is: signInSuccessWithAuthResult says user logged in, but authProvider says no user logged in.

I appreciate your advice. thanks.

rjjan avatar Nov 16 '23 17:11 rjjan

I have the same issue. This is especially problematic when using login with buttons (like Google) because it requires a full page reload to update the auth state.

I'm not sure but this could be down to firebaseui and react-admin-firebase not using the same firebase app instance. I.e. this could be solved by providing a way to access the firebase app instance externally.

slax57 avatar Apr 09 '25 09:04 slax57