Skip to content

Commit

Permalink
fix for password-reset
Browse files Browse the repository at this point in the history
  • Loading branch information
parsa-asgari committed Apr 25, 2024
1 parent ebad4e9 commit 56c854e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/reset-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ import { cookies } from 'next/headers'
import { redirect } from 'next/navigation'

export default async function ResetPassword() {
const cookieStore = cookies()
const session = await authUser()
// redirect to home if user is already logged in
if (session?.user) {
redirect('/')
try{
const session = await authUser()
// redirect to home if user is already logged in
if (session?.user) {
redirect('/')
}
}
catch{
undefined
}

return (
<div className="flex h-[calc(100vh-theme(spacing.16))] flex-col items-center justify-center py-10">
<div className="w-full max-w-sm">
Expand Down

0 comments on commit 56c854e

Please sign in to comment.