Skip to content
Discussion options

You must be logged in to vote

I managed to retrieve the token like this :

export default withAuth({
  pages: {
    signIn: '/auth/signin',
  },
  callbacks: {
    authorized: ({ req }) => {
      const cookie = req.headers.get('cookie');
      const accessToken = cookie.split('accessToken=')[1].split(';')[0];
      // Do your logic
      return !!accessToken
    },
  },
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by atissedredecathlon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant