是否有任何示例和/或方法可以在成功登录或注册凭据类型时重定向到私人仪表板next-auth
?我找不到任何明确的文档。
我正在考虑在下面添加重定向,但不确定这是否是正确的方法:
callbacks.signIn = async (data, account, profile) => {
if ((account.provider === 'google' && profile.verified_email === true) || (account.type === 'credentials' && data.status === 200)) {
return Promise.resolve(true)
} else {
return Promise.resolve(false)
}
}