Skip to content

Commit

Permalink
✨ Revalidate the layout after sign in and sign out (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
usatie authored Feb 6, 2024
1 parent 88fe248 commit 8120fcd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/app/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
export async function signOut() {
cookies()?.delete("token");
destroySession();
revalidatePath("/", "layout");
redirect("/");
}

Expand Down Expand Up @@ -55,6 +56,7 @@ export async function authenticate(
email: formData.get("email") as string,
password: formData.get("password") as string,
});
revalidatePath("/", "layout");
redirect("/");
} catch (error) {
if ((error as Error).message.includes("Authentication failed")) {
Expand Down

0 comments on commit 8120fcd

Please sign in to comment.