Skip to content

Commit

Permalink
Update the token after email confirmation.
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheidudko committed Jan 16, 2024
1 parent 78bc915 commit 30165cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/auth/Action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
sendPasswordResetEmail,
confirmPasswordReset,
applyActionCode,
getIdToken,
} from "firebase/auth";
import FirebaseAuth, { errorMessagesMap } from "../../services/FirebaseAuth";
import { Alert, Snackbar } from "@mui/material";
Expand Down Expand Up @@ -116,12 +117,14 @@ export default function Action() {
}
setActionIsRunning(true);
await applyActionCode(FirebaseAuth, oobCode)
.then(() => {
.then(async () => {
setShowMsg({
type: "info",
message: "The address has been confirmed, you need to log in again.",
isShown: true,
});
if (FirebaseAuth.currentUser)
await getIdToken(FirebaseAuth.currentUser, true);
setTimeout(() => {
navigate("/");
window.location.reload();
Expand Down

0 comments on commit 30165cc

Please sign in to comment.