1.2.16 • Published 4 days ago
elysia-auth-drizzle v1.2.16
elysia-auth-drizzle
Library who handle authentification (Header/Cookie/QueryParam).
Usage
import { elysiaAuthDrizzlePlugin } from 'elysia-auth-drizzle';
export const app = new Elysia()
.use(
elysiaAuthDrizzlePlugin<typeof users.$inferSelect>({
config: [
{
url: '/public',
method: 'GET',
},
],
jwtSecret: 'test',
drizzle: {
db: db,
usersSchema: users,
tokensSchema: tokens,
},
}),
)
Plugin options
name | default | description |
---|---|---|
jwtSecret | undefined | Secret used to sign JWT |
drizzle | undefined | Contain drizzle db + users schema + tokens schemas ({db, userSchemas, tokenSchemas} / Token Schemas is optional if you use verifyAccessTokenOnlyInJWT) |
config | [] | Array who contain url with method allowed in public |
cookieSecret | undefined | (optional) Secret used to sign cookie value |
verifyAccessTokenOnlyInJWT | false | (optional) Check only JWT expiration not token validity in DB |
userValidation | undefined | (optional) (user) => void or Promise<void> / Allow to make more check regarding user (ex: check if user is banned) |
Tests
To execute jest tests (all errors, type integrity test)
bun test
1.2.16
4 days ago
1.2.14
4 days ago
1.2.15
4 days ago
1.2.9
10 days ago
1.2.12
9 days ago
1.2.13
9 days ago
1.2.10
10 days ago
1.2.11
10 days ago
1.2.8
11 days ago
1.2.7
13 days ago
1.2.6
14 days ago
1.2.5
14 days ago
1.2.4
14 days ago
1.2.3
14 days ago
1.2.2
15 days ago
1.2.1
15 days ago
1.2.0
16 days ago
1.1.19
22 days ago
1.1.18
22 days ago
1.1.20
21 days ago
1.1.17
30 days ago
1.1.16
1 month ago
1.1.15
1 month ago
1.1.14
1 month ago
1.1.13
2 months ago
1.1.12
2 months ago
1.1.11
2 months ago
1.1.10
2 months ago
1.1.9
2 months ago
1.1.8
2 months ago
1.1.7
2 months ago
1.1.6
2 months ago
1.1.5
2 months ago
1.1.4
2 months ago
1.1.3
2 months ago
1.1.1
2 months ago
1.1.0
2 months ago
1.1.2
2 months ago
1.0.4
2 months ago
1.0.3
2 months ago
1.0.2
2 months ago
1.0.1
2 months ago
1.0.0
2 months ago