useUser only gets metadata updates after new user logs out and back in

Continuing the discussion from NextJS useUser Not Getting App Metadata:

I have a similar problem to the issue I’ve linked here. I have a postLogin action that sets some custom claims for a user, in order for us to read their roles from Auth0 in our app using useUser() from nextjs-auth0.

However, the roles only appear on the user returned from useUser() after the user has logged out and logged back in after signup. It does not work when a new user registers an account without them logging out. I don’t want our users to create an account, then have to get logged out and log back in immediately so that they can access certain pages. I’m sure there’s already some way to handle this, please advise :slight_smile:

Steff