Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/next 15 #387

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from 3cc94e to 97b8ef
158 changes: 82 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"jsonwebtoken": "^9.0.2",
"jsqr": "^1.4.0",
"luxon": "^3.5.0",
"next": "^14.2.5",
"next": "^15.0.3",
"next-auth": "^4.24.11",
"next-qrcode": "^2.5.1",
"nodemailer": "^6.9.16",
Expand Down
14 changes: 8 additions & 6 deletions src/app/(auth)/auth/reset-password/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import ResetPasswordForm from './resetpasswordForm'
import { verifyResetPasswordTokenAction } from '@/actions/auth/resetPassword'
import { QueryParams } from '@/lib/query-params/queryParams'
import type { SearchParamsServerSide } from '@/lib/query-params/Types'

type PropTypes = {
searchParams: Record<string, string | string[] | undefined>
}
type PropTypes = SearchParamsServerSide

export default async function ResetPassword({ searchParams }: PropTypes) {
if (!searchParams.token || typeof searchParams.token !== 'string') {
const token = QueryParams.token.decode(await searchParams)

if (!token) {
return <>
<h1>Ops</h1>
<p>Token mangler</p>
</>
}
const verify = await verifyResetPasswordTokenAction(searchParams.token)
const verify = await verifyResetPasswordTokenAction(token)

if (!verify.success) {
const errorMessage = verify.error?.map(e => e.message).join('\n') ?? 'JWT er ugyldig'
Expand All @@ -23,5 +25,5 @@ export default async function ResetPassword({ searchParams }: PropTypes) {
</>
}

return <ResetPasswordForm token={searchParams.token} />
return <ResetPasswordForm token={token} />
}
Loading