Hi @chaitrk
Welcome back to the Auth0 Community!
In the case of the NextJS SDK, the client must be configured to save the additional claims added to the token otherwise they will be filtered out since they are not part of the default claims. You can read more about that in our documentation and this small tutorial I have made on our DevHub forum.
You will need to add the following piece of code to your application in order for any added custom claims to be included.
import { Auth0Client } from "@auth0/nextjs-auth0/server";
export const auth0 = new Auth0Client({
async beforeSessionSaved(session, idToken) {
return session;
}
});
Let me know if that does the trick.
Kind Regards,
Nik