Closed christiangenco closed 8 months ago
@christiangenco I'm not certain how to work around that hook. Even with a new callback function, a useEffect
redirect would still route them once they're signed in, regardless of what's in the callback function. The existing callback function is designed to handle for this, however. If the user signs in with a reset password link, signInSuccessWithAuthResult
won't trigger until they've finished resetting their password.
The following should work:
signInSuccessWithAuthResult: () => {
router.push("/")
}
For posterity, that's the config.callbacks.signInSuccessWithAuthResult
prop:
<ReactFirebaseUI config={{
callbacks: {
signInSuccessWithAuthResult: onSuccess,
},
}} />
After landing on the login page to reset my password, if I have the following hook in place I don't get a chance to reset my password because I'm redirected before I can:
Ideally I would pass a function prop to
<ReactFirebaseUI />
that runs after I'm logged in and I've done whatever I need to do like password resetting. Something likeonSuccessfulLogin
?