From 8120fcdb1a402d424cf29c1c2e11061f0fec0be8 Mon Sep 17 00:00:00 2001 From: Shun Usami Date: Tue, 6 Feb 2024 09:14:41 -0800 Subject: [PATCH] :sparkles: Revalidate the layout after sign in and sign out (#245) --- frontend/app/lib/actions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/app/lib/actions.ts b/frontend/app/lib/actions.ts index 86b47e3c..52d0d237 100644 --- a/frontend/app/lib/actions.ts +++ b/frontend/app/lib/actions.ts @@ -22,6 +22,7 @@ import { export async function signOut() { cookies()?.delete("token"); destroySession(); + revalidatePath("/", "layout"); redirect("/"); } @@ -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")) {