@warlock.js/auth 4.0.174 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/cjs/index.cjs +807 -0
- package/cjs/index.cjs.map +1 -0
- package/esm/commands/auth-cleanup-command.d.mts +13 -0
- package/esm/commands/auth-cleanup-command.d.mts.map +1 -0
- package/esm/commands/auth-cleanup-command.mjs +34 -0
- package/esm/commands/auth-cleanup-command.mjs.map +1 -0
- package/esm/commands/jwt-secret-generator-command.d.mts +5 -0
- package/esm/commands/jwt-secret-generator-command.d.mts.map +1 -0
- package/esm/commands/jwt-secret-generator-command.mjs +15 -0
- package/esm/commands/jwt-secret-generator-command.mjs.map +1 -0
- package/esm/contracts/auth-contract.d.mts +40 -0
- package/esm/contracts/auth-contract.d.mts.map +1 -0
- package/esm/contracts/index.d.mts +2 -0
- package/esm/contracts/types.d.mts +170 -0
- package/esm/contracts/types.d.mts.map +1 -0
- package/esm/contracts/types.mjs +25 -0
- package/esm/contracts/types.mjs.map +1 -0
- package/esm/index.d.mts +15 -0
- package/esm/index.mjs +17 -0
- package/esm/middleware/auth.middleware.d.mts +22 -0
- package/esm/middleware/auth.middleware.d.mts.map +1 -0
- package/esm/middleware/auth.middleware.mjs +72 -0
- package/esm/middleware/auth.middleware.mjs.map +1 -0
- package/esm/middleware/index.mjs +3 -0
- package/esm/models/access-token/access-token.model.d.mts +13 -0
- package/esm/models/access-token/access-token.model.d.mts.map +1 -0
- package/esm/models/access-token/access-token.model.mjs +23 -0
- package/esm/models/access-token/access-token.model.mjs.map +1 -0
- package/esm/models/access-token/index.d.mts +1 -0
- package/esm/models/access-token/index.mjs +3 -0
- package/esm/models/access-token/migration.mjs +24 -0
- package/esm/models/access-token/migration.mjs.map +1 -0
- package/esm/models/auth.model.d.mts +63 -0
- package/esm/models/auth.model.d.mts.map +1 -0
- package/esm/models/auth.model.mjs +77 -0
- package/esm/models/auth.model.mjs.map +1 -0
- package/esm/models/index.d.mts +8 -0
- package/esm/models/index.d.mts.map +1 -0
- package/esm/models/index.mjs +14 -0
- package/esm/models/index.mjs.map +1 -0
- package/esm/models/refresh-token/index.d.mts +1 -0
- package/esm/models/refresh-token/index.mjs +3 -0
- package/esm/models/refresh-token/migration.mjs +27 -0
- package/esm/models/refresh-token/migration.mjs.map +1 -0
- package/esm/models/refresh-token/refresh-token.model.d.mts +36 -0
- package/esm/models/refresh-token/refresh-token.model.d.mts.map +1 -0
- package/esm/models/refresh-token/refresh-token.model.mjs +58 -0
- package/esm/models/refresh-token/refresh-token.model.mjs.map +1 -0
- package/esm/services/auth-events.d.mts +89 -0
- package/esm/services/auth-events.d.mts.map +1 -0
- package/esm/services/auth-events.mjs +68 -0
- package/esm/services/auth-events.mjs.map +1 -0
- package/esm/services/auth.service.d.mts +95 -0
- package/esm/services/auth.service.d.mts.map +1 -0
- package/esm/services/auth.service.mjs +275 -0
- package/esm/services/auth.service.mjs.map +1 -0
- package/esm/services/generate-jwt-secret.d.mts +5 -0
- package/esm/services/generate-jwt-secret.d.mts.map +1 -0
- package/esm/services/generate-jwt-secret.mjs +48 -0
- package/esm/services/generate-jwt-secret.mjs.map +1 -0
- package/esm/services/index.d.mts +4 -0
- package/esm/services/index.mjs +6 -0
- package/esm/services/jwt.d.mts +52 -0
- package/esm/services/jwt.d.mts.map +1 -0
- package/esm/services/jwt.mjs +58 -0
- package/esm/services/jwt.mjs.map +1 -0
- package/esm/utils/auth-error-codes.d.mts +23 -0
- package/esm/utils/auth-error-codes.d.mts.map +1 -0
- package/esm/utils/auth-error-codes.mjs +23 -0
- package/esm/utils/auth-error-codes.mjs.map +1 -0
- package/llms-full.txt +1023 -0
- package/llms.txt +16 -0
- package/package.json +47 -36
- package/skills/auth-basics/SKILL.md +88 -0
- package/skills/customize-user-type/SKILL.md +137 -0
- package/skills/handle-login-and-logout/SKILL.md +160 -0
- package/skills/manage-tokens/SKILL.md +169 -0
- package/skills/overview/SKILL.md +66 -0
- package/skills/protect-routes/SKILL.md +105 -0
- package/skills/register-user/SKILL.md +135 -0
- package/skills/run-auth-commands/SKILL.md +125 -0
- package/esm/commands/auth-cleanup-command.d.ts +0 -10
- package/esm/commands/auth-cleanup-command.d.ts.map +0 -1
- package/esm/commands/auth-cleanup-command.js +0 -29
- package/esm/commands/auth-cleanup-command.js.map +0 -1
- package/esm/commands/jwt-secret-generator-command.d.ts +0 -2
- package/esm/commands/jwt-secret-generator-command.d.ts.map +0 -1
- package/esm/commands/jwt-secret-generator-command.js +0 -7
- package/esm/commands/jwt-secret-generator-command.js.map +0 -1
- package/esm/contracts/auth-contract.d.ts +0 -23
- package/esm/contracts/auth-contract.d.ts.map +0 -1
- package/esm/contracts/index.d.ts +0 -3
- package/esm/contracts/index.d.ts.map +0 -1
- package/esm/contracts/types.d.ts +0 -167
- package/esm/contracts/types.d.ts.map +0 -1
- package/esm/contracts/types.js +0 -20
- package/esm/contracts/types.js.map +0 -1
- package/esm/index.d.ts +0 -8
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -1
- package/esm/index.js.map +0 -1
- package/esm/middleware/auth.middleware.d.ts +0 -2
- package/esm/middleware/auth.middleware.d.ts.map +0 -1
- package/esm/middleware/auth.middleware.js +0 -72
- package/esm/middleware/auth.middleware.js.map +0 -1
- package/esm/middleware/index.d.ts +0 -2
- package/esm/middleware/index.d.ts.map +0 -1
- package/esm/models/access-token/access-token.model.d.ts +0 -9
- package/esm/models/access-token/access-token.model.d.ts.map +0 -1
- package/esm/models/access-token/access-token.model.js +0 -14
- package/esm/models/access-token/access-token.model.js.map +0 -1
- package/esm/models/access-token/index.d.ts +0 -2
- package/esm/models/access-token/index.d.ts.map +0 -1
- package/esm/models/access-token/migration.d.ts +0 -2
- package/esm/models/access-token/migration.d.ts.map +0 -1
- package/esm/models/access-token/migration.js +0 -22
- package/esm/models/access-token/migration.js.map +0 -1
- package/esm/models/auth.model.d.ts +0 -58
- package/esm/models/auth.model.d.ts.map +0 -1
- package/esm/models/auth.model.js +0 -68
- package/esm/models/auth.model.js.map +0 -1
- package/esm/models/index.d.ts +0 -5
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -1
- package/esm/models/index.js.map +0 -1
- package/esm/models/refresh-token/index.d.ts +0 -2
- package/esm/models/refresh-token/index.d.ts.map +0 -1
- package/esm/models/refresh-token/migration.d.ts +0 -2
- package/esm/models/refresh-token/migration.d.ts.map +0 -1
- package/esm/models/refresh-token/migration.js +0 -23
- package/esm/models/refresh-token/migration.js.map +0 -1
- package/esm/models/refresh-token/refresh-token.model.d.ts +0 -32
- package/esm/models/refresh-token/refresh-token.model.d.ts.map +0 -1
- package/esm/models/refresh-token/refresh-token.model.js +0 -53
- package/esm/models/refresh-token/refresh-token.model.js.map +0 -1
- package/esm/services/auth-events.d.ts +0 -85
- package/esm/services/auth-events.d.ts.map +0 -1
- package/esm/services/auth-events.js +0 -65
- package/esm/services/auth-events.js.map +0 -1
- package/esm/services/auth.service.d.ts +0 -92
- package/esm/services/auth.service.d.ts.map +0 -1
- package/esm/services/auth.service.js +0 -322
- package/esm/services/auth.service.js.map +0 -1
- package/esm/services/generate-jwt-secret.d.ts +0 -2
- package/esm/services/generate-jwt-secret.d.ts.map +0 -1
- package/esm/services/generate-jwt-secret.js +0 -47
- package/esm/services/generate-jwt-secret.js.map +0 -1
- package/esm/services/index.d.ts +0 -5
- package/esm/services/index.d.ts.map +0 -1
- package/esm/services/jwt.d.ts +0 -23
- package/esm/services/jwt.d.ts.map +0 -1
- package/esm/services/jwt.js +0 -40
- package/esm/services/jwt.js.map +0 -1
- package/esm/utils/auth-error-codes.d.ts +0 -18
- package/esm/utils/auth-error-codes.d.ts.map +0 -1
- package/esm/utils/auth-error-codes.js +0 -18
- package/esm/utils/auth-error-codes.js.map +0 -1
- package/esm/utils/duration.d.ts +0 -45
- package/esm/utils/duration.d.ts.map +0 -1
- package/esm/utils/duration.js +0 -93
- package/esm/utils/duration.js.map +0 -1
- package/esm/utils/index.d.ts +0 -3
- package/esm/utils/index.d.ts.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Warlock Auth
|
|
2
|
+
|
|
3
|
+
Auth System for Warlock.js
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`yarn create @warlock.js/auth`
|
|
8
|
+
|
|
9
|
+
Or
|
|
10
|
+
|
|
11
|
+
`npx create @warlock.js/auth`
|
|
12
|
+
|
|
13
|
+
Or
|
|
14
|
+
|
|
15
|
+
`pnpm create @warlock.js/auth`
|
|
16
|
+
|
|
17
|
+
## Generate JWT Secret
|
|
18
|
+
|
|
19
|
+
To generate JWT secret key, we need to add the following code to the `warlock.config.ts` file.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { registerJWTSecretGeneratorCommand } from "@warlock.js/auth";
|
|
23
|
+
import { defineConfig } from "@warlock.js/core";
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
// Other configurations
|
|
27
|
+
cli: {
|
|
28
|
+
commands: [registerJWTSecretGeneratorCommand()],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then run the following command:
|
|
34
|
+
|
|
35
|
+
`warlock jwt.generate`
|
|
36
|
+
|
|
37
|
+
It will generate
|