window is not defined
Answered
Atlantic mackerel posted this in #help-forum
Atlantic mackerelOP
Hey guys, Im using
So I tried this:
but the error said:
How can I redirect after login?
next-auth
and I want to redirect after login successfulSo I tried this:
async jwt({token, account}: any) {
if (account) {
token.accessToken = account.access_token;
if (window !== undefined)
window.location.href = "motion://" + token.accessToken
console.log("test" + token.accessToken)
}
return token;
},
but the error said:
[NEXT] message: 'window is not defined',
[NEXT] stack: 'ReferenceError: window is not defined\n'
How can I redirect after login?