How to use the nookies.destroyCookie function in nookies

To help you get started, we’ve selected a few nookies 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 codeleakteam / codeleak / nextjs / helpers / functions / auth.js View on Github external
export const logout = () => {
  destroyCookie(undefined, 'codeleakUser')
  destroyCookie(undefined, 'codeleakAuthToken')

  // window.localStorage.setItem("logout", Date.now()guardialo on successguardialo on success);

  console.log('Logged out. Redirecting')
  Router.push('/')
  message.success('Successfully logged out!')
}
github codeleakteam / codeleak / nextjs / helpers / functions / auth.js View on Github external
export const logout = () => {
  destroyCookie(undefined, 'codeleakUser')
  destroyCookie(undefined, 'codeleakAuthToken')

  // window.localStorage.setItem("logout", Date.now()guardialo on successguardialo on success);

  console.log('Logged out. Redirecting')
  Router.push('/')
  message.success('Successfully logged out!')
}
github Enalmada / next-reason-boilerplate / pages / auth / signout.js View on Github external
static async getInitialProps(context) {
        const {loggedInUser} = await checkLoggedIn(context.apolloClient);

        if (!loggedInUser.user) {
            // If not signed in, send them somewhere more useful
            redirect(context, "/");
        }

        destroyCookie(context, "token");

        /* https://www.apollographql.com/docs/react/recipes/authentication.html#login-logout */
        context.apolloClient.resetStore().then(() => {
            redirect({}, "/");
        });

        return {loggedInUser};
    }
github wassgha / digital-signage / helpers / auth.js View on Github external
return axios.get(host + '/api/v1/user/logout').then(res => {
    if (res && res.data) {
      destroyCookie({}, 'loggedIn')
      Router.push('/login')
      window.location.href = '/login'
    }
    return res.data
  })
}
github codeleakteam / codeleak / nextjs / pages / sign_in.js View on Github external
componentDidMount() {
    destroyCookie(undefined, 'codeleakUser')
    destroyCookie(undefined, 'codeleakAuthToken')
  }
github codeleakteam / codeleak / nextjs / pages / sign_in.js View on Github external
componentDidMount() {
    destroyCookie(undefined, 'codeleakUser')
    destroyCookie(undefined, 'codeleakAuthToken')
  }

nookies

A set of cookie helpers for Next.js

MIT
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis