get user roles

This commit is contained in:
2025-12-07 17:47:34 -07:00
parent 57564df115
commit 8301a5e738
2 changed files with 17 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
# CopilotKit <> LangGraph Starter
### Referenes
https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md
This is a starter template for building AI agents using [LangGraph](https://www.langchain.com/langgraph) and [CopilotKit](https://copilotkit.ai). It provides a modern Next.js application with an integrated LangGraph agent to be built on top of.
## Prerequisites
@@ -102,4 +106,4 @@ If you see "I'm having trouble connecting to my tools", make sure:
If you encounter Python import errors:
```bash
npm install:agent
```
```

View File

@@ -1,3 +1,13 @@
import { Auth0Client } from '@auth0/nextjs-auth0/server';
import { Auth0Client, filterDefaultIdTokenClaims } from '@auth0/nextjs-auth0/server';
export const auth0 = new Auth0Client();
export const auth0 = new Auth0Client({
async beforeSessionSaved(session, idToken) {
return {
...session,
user: {
...filterDefaultIdTokenClaims(session.user),
roles: session.user['https://chat.caving.dev/roles']
}
};
}
});