How to use the next-auth/client.NextAuth.signout function in next-auth

To help you get started, we’ve selected a few next-auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iaincollins / nextjs-starter / components / layout.js View on Github external
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('/')
   }
github datavis-tech / vizhub-legacy / packages / web / components / molecules / userMenu.js View on Github external
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);
  }
github iaincollins / next-auth / example / pages / index.js View on Github external
handleSignOutSubmit(event) {
    event.preventDefault()
    NextAuth.signout()
    .then(() => {
      Router.push('/auth/callback')
    })
    .catch(err => {
      Router.push('/auth/error?action=signout')
    })
  }