Open Master-Y0da opened 6 months ago
I think you could just specify the payload using the schema
field.
Here's a random example I had:
export const jwtRefreshSetup = new Elysia().use(jwt({
name: 'jwtRefresh',
alg: 'HS256',
secret: 'fjdfkdjfdkfjdkjdkfjkfjkfjd',
schema: t.Object({
id: t.String(),
scope: t.Array(t.Union([
t.Literal('profile'),
t.Literal('media'),
t.Literal('admin'),
])),
}),
iss: JWT_ISSUER,
exp: JWT_REFRESH_TOKEN_DURATION,
type: 'refresh',
}));
I'm trying to use this plugin...but can't find a way or configuration that enable the use of scopes asigned to the generated JWT...is this possible ?
thanks for your help!