setting state param in nextauth

Does anyone know how to set the state query key to oauth providers instead of having nextauth set it automatically? I'm using Auth0 so I need my custom state value sent to the /authorize endpoint and returned back to my callback
1 Reply
antoine
antoineOP16mo ago
my attempt:
Auth0Provider({
...,
token: {
params: {
url: env.AUTH0_ISSUER + "/oauth/token",
state: btoa(
JSON.stringify({
key: "val",
})),
},
},
}),
Auth0Provider({
...,
token: {
params: {
url: env.AUTH0_ISSUER + "/oauth/token",
state: btoa(
JSON.stringify({
key: "val",
})),
},
},
}),
error message:
{
...,
message: 'state mismatch, expected 'something', got: 'something else'
}
{
...,
message: 'state mismatch, expected 'something', got: 'something else'
}
Want results from more Discord servers?
Add your server