Reading accessToken right after login

I am trying to access a user permission right after log in and make some checks in nextjs. If the checks fail, i want to be sent back to login form.

1 Like

Hi,
you could implement a HOC (Higher Order Component) called withRoleAuthorization that wraps around withPageAuthRequired.
This HOC will allow for checks against user permissions or roles right after login. If these checks fail according to your criteria, the HOC can handle redirection back to the login form