This commit is contained in:
2026-06-24 15:34:09 +02:00
commit 65fb6816ca
442 changed files with 27246 additions and 0 deletions
@@ -0,0 +1,36 @@
import { PasswordResetForm } from '@/components'
import { SESSION_COOKIE_NAME } from '@/constants'
import { CheckResetPasswordTokenDocument } from '@/generated/graphql/graphql'
import { createApolloClient } from '@/lib'
import { Text } from '@chakra-ui/react'
import { cookies } from 'next/headers'
interface Props {
params: Promise<{
token: string
}>
}
export const dynamic = 'force-dynamic'
const ResetPasswordPage: React.FC<Props> = async ({ params }) => {
const { token } = await params
const cookieStore = await cookies()
const cookie = cookieStore.get(SESSION_COOKIE_NAME)?.value
const apollo = await createApolloClient(cookie)
const { data, error } = await apollo.query({ query: CheckResetPasswordTokenDocument, variables: { token } })
if (error || data === undefined) {
console.log(error)
return <Text>An error has occured. Please try again later.</Text>
}
else if (!data.checkResetPasswordToken) {
return <Text>Invalid token!</Text>
}
else {
return <PasswordResetForm token={token}/>
}
}
export default ResetPasswordPage