Skip to content

Commit

Permalink
redirection fix
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshuverma-dev committed Oct 3, 2024
1 parent d319a74 commit 782f7f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ export default async function RootLayout({
const h = headers();
const pathname = h.get("x-current-path");

if (!session?.user.emailVerified) {
if (!pathname!.includes("/auth")) {
redirect("/auth/verify");
if (session) {
if (!session.user.emailVerified) {
if (!pathname!.includes("/auth")) {
redirect("/auth/verify");
}
}
}

Expand Down

0 comments on commit 782f7f3

Please sign in to comment.