Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async handleSignoutSubmit(event) {
event.preventDefault()
// Save current URL so user is redirected back here after signing out
const cookies = new Cookies()
cookies.set('redirect_url', window.location.pathname, { path: '/' })
await NextAuth.signout()
Router.push('/')
}
async onSignOut() {
// Save current URL so user is redirected back here after signing out
const cookies = new Cookies();
cookies.set('redirect_url', window.location.pathname, { path: '/' });
await NextAuth.signout();
location.reload(true);
}
handleSignOutSubmit(event) {
event.preventDefault()
NextAuth.signout()
.then(() => {
Router.push('/auth/callback')
})
.catch(err => {
Router.push('/auth/error?action=signout')
})
}