get user roles
This commit is contained in:
@@ -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
|
||||
```
|
||||
```
|
||||
|
||||
@@ -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']
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user