Open atej opened 9 months ago
This is my current patch:
// ...
try {
res.headers.delete('Set-Cookie')
} catch(error) {
if (error instanceof TypeError) {
return redirect(prefix + '/error?error=Verification', 303)
}
return redirect(prefix + '/error?error=Default', 303)
}
//...
I just encountered this issue as well with the slack integration
I was able to fix this issue by adding checks: ["pkce", "nonce"]
to the slack config in the auth.config.mjs file
Setup with an Email provider. Sign in via magic link works.
The problem arises when you click on a magic link that was previously used. Expected behaviour is redirection to the error page with the search param
?error=Verification
.However, it leads to a
TypeError immutable
The erring line
res.headers.delete('Set-Cookie')
This, I suspect is because the headers
guard
is set toimmutable
. More hereSo, a work-around:
This avoids the crash, but still no redirection to the error page, simply a
200
response.I do see the error being logged though: