mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
fix: allow Response as return type of authorized
This commit is contained in:
@@ -54,7 +54,7 @@ export interface NextAuthConfig extends AuthConfig {
|
||||
request: NextRequest
|
||||
/** The authenticated user or token, if any. */
|
||||
auth: Session | null
|
||||
}) => Awaitable<boolean | NextResponse | undefined>
|
||||
}) => Awaitable<boolean | NextResponse | Response | undefined>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ async function handleAuth(
|
||||
const sessionResponse = await getSession(request.headers, config)
|
||||
const auth = await sessionResponse.json()
|
||||
|
||||
let authorized: boolean | NextResponse | undefined = true
|
||||
let authorized: boolean | NextResponse | Response | undefined = true
|
||||
|
||||
if (config.callbacks?.authorized) {
|
||||
authorized = await config.callbacks.authorized({ request, auth })
|
||||
|
||||
Reference in New Issue
Block a user