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

Version 4.1 auth0.getSession(ctx.req) not return user role #1980

Closed
6 tasks done
NguyenCao-Glams opened this issue Mar 20, 2025 · 2 comments
Closed
6 tasks done

Version 4.1 auth0.getSession(ctx.req) not return user role #1980

NguyenCao-Glams opened this issue Mar 20, 2025 · 2 comments

Comments

@NguyenCao-Glams
Copy link

NguyenCao-Glams commented Mar 20, 2025

Checklist

Description

In version 2.7, user in session has role, but in version 4.1 don't have.

Image Image

Reproduction

const session = await auth0.getSession(ctx.req)
console.log(session)

Additional context

No response

nextjs-auth0 version

4.1

Next.js version

15.1.7

Node.js version

22.14

@seanparmelee
Copy link
Contributor

You'll have to manually copy that claim over via the beforeSessionSaved hook: https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md#id-token-claims-and-the-user-object

@NguyenCao-Glams
Copy link
Author

Hi @seanparmelee ,
Thank you very much.
I can get user role now.

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

2 participants