@veloxts/auth 0.6.85 → 0.6.87
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/CHANGELOG.md +18 -0
- package/GUIDE.md +16 -3
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @veloxts/auth
|
|
2
2
|
|
|
3
|
+
## 0.6.87
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added missing documentations in left nav + primary colors from favicon
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @veloxts/core@0.6.87
|
|
10
|
+
- @veloxts/router@0.6.87
|
|
11
|
+
|
|
12
|
+
## 0.6.86
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- updated documentation
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @veloxts/core@0.6.86
|
|
19
|
+
- @veloxts/router@0.6.86
|
|
20
|
+
|
|
3
21
|
## 0.6.85
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/GUIDE.md
CHANGED
|
@@ -54,14 +54,27 @@ const getProfile = procedure()
|
|
|
54
54
|
## Guards
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
import { hasRole, hasPermission } from '@veloxts/auth';
|
|
57
|
+
import { authenticated, hasRole, hasPermission } from '@veloxts/auth';
|
|
58
58
|
|
|
59
|
+
// Require authentication
|
|
60
|
+
const getProfile = procedure()
|
|
61
|
+
.guard(authenticated)
|
|
62
|
+
.query(({ ctx }) => ctx.user);
|
|
63
|
+
|
|
64
|
+
// Require admin role
|
|
59
65
|
const adminOnly = procedure()
|
|
60
|
-
.
|
|
66
|
+
.guard(hasRole('admin'))
|
|
61
67
|
.mutation(handler);
|
|
62
68
|
|
|
69
|
+
// Require specific permission
|
|
63
70
|
const canEdit = procedure()
|
|
64
|
-
.
|
|
71
|
+
.guard(hasPermission('posts.write'))
|
|
72
|
+
.mutation(handler);
|
|
73
|
+
|
|
74
|
+
// Chain multiple guards (all must pass)
|
|
75
|
+
const adminWithPermission = procedure()
|
|
76
|
+
.guard(authenticated)
|
|
77
|
+
.guard(hasRole('admin'))
|
|
65
78
|
.mutation(handler);
|
|
66
79
|
```
|
|
67
80
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/auth",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.87",
|
|
4
4
|
"description": "Authentication and authorization system for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@fastify/cookie": "11.0.2",
|
|
63
63
|
"fastify": "5.6.2",
|
|
64
|
-
"@veloxts/core": "0.6.
|
|
65
|
-
"@veloxts/router": "0.6.
|
|
64
|
+
"@veloxts/core": "0.6.87",
|
|
65
|
+
"@veloxts/router": "0.6.87"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"argon2": ">=0.30.0",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"fastify-plugin": "5.1.0",
|
|
87
87
|
"typescript": "5.9.3",
|
|
88
88
|
"vitest": "4.0.16",
|
|
89
|
-
"@veloxts/validation": "0.6.
|
|
90
|
-
"@veloxts/testing": "0.6.
|
|
89
|
+
"@veloxts/validation": "0.6.87",
|
|
90
|
+
"@veloxts/testing": "0.6.87"
|
|
91
91
|
},
|
|
92
92
|
"keywords": [
|
|
93
93
|
"velox",
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"typescript"
|
|
101
101
|
],
|
|
102
102
|
"license": "MIT",
|
|
103
|
+
"homepage": "https://veloxts.dev/",
|
|
103
104
|
"repository": {
|
|
104
105
|
"type": "git",
|
|
105
106
|
"url": "https://github.com/veloxts/velox-ts-framework",
|