We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a689b4 commit 2432ce9Copy full SHA for 2432ce9
packages/next-auth/src/core/lib/oauth/state-handler.ts
@@ -49,7 +49,9 @@ export async function useState(
49
): Promise<{ value: string; cookie: Cookie } | undefined> {
50
const { cookies, provider, jwt } = options
51
52
- if (!provider.checks?.includes("state") || !state) return
+ if (!provider.checks?.includes("state")) return
53
+
54
+ if (!state) throw new Error("No state provided")
55
56
const value = (await jwt.decode({ ...options.jwt, token: state })) as any
57
0 commit comments