Skip to content
Open
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
7 changes: 5 additions & 2 deletions docs/pages/guides/pages/signin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ import { AuthError } from "next-auth"
const SIGNIN_ERROR_URL = "/error"

export default async function SignInPage(props: {
searchParams: { callbackUrl: string | undefined }
searchParams: Promise<{ callbackUrl: string | undefined }>
}) {

const { callbackUrl } = await props.searchParams;

return (
<div className="flex flex-col gap-2">
<form
Expand Down Expand Up @@ -170,7 +173,7 @@ export default async function SignInPage(props: {
"use server"
try {
await signIn(provider.id, {
redirectTo: props.searchParams?.callbackUrl ?? "",
redirectTo: callbackUrl ?? "",
})
} catch (error) {
// Signin can fail for a number of reasons, such as the user
Expand Down