Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clear the redux persist through the next server side #1

Open
mariosantosdev opened this issue Apr 22, 2022 · 0 comments
Open

Comments

@mariosantosdev
Copy link

The @diego3g use the nookies to verify if the cookie of the token is created to prevent access to an inner page, like the below code!

const { ['nextauth.token']: token } = parseCookies(ctx)

  if (!token) {
    return {
      redirect: {
        destination: '/',
        permanent: false,
      }
    }
  }

In this project the content of the user is storaged in context... but I'm using the redux with the redux-persist (save in local storage)!

When the token was expired, the nookies redirect user to /login but the redux storage still have informations in local storage! How I remove the informations of redux-persist accessing inside the getServerSideProps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant