@cfast/auth 0.2.1 → 0.2.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/llms.txt +5 -0
  3. package/package.json +10 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Schmidt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/llms.txt CHANGED
@@ -214,3 +214,8 @@ await auth.removeRole(userId, "editor");
214
214
  - **Forgetting to add auth routes** -- The magic link callback and passkey endpoints need `authRoutes()` in your `routes.ts`.
215
215
  - **Using `unsafe()` instead of roles for admin** -- Admins should have a proper role with grants, not bypass permissions entirely.
216
216
  - **Not wrapping the app with `AuthClientProvider`** -- `useAuth()` and `LoginPage` require the provider at the app root.
217
+
218
+ ## See Also
219
+
220
+ - `@cfast/permissions` -- Defines roles and grants resolved from the authenticated user.
221
+ - `@cfast/db` -- Receives `grants` from auth to enforce permissions on queries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfast/auth",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Authentication for Cloudflare Workers: magic email, passkeys, roles, and impersonation",
5
5
  "keywords": [
6
6
  "cfast",
@@ -44,13 +44,6 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "scripts": {
48
- "build": "tsup src/index.ts src/client.ts src/plugin.ts src/schema.ts --format esm --dts",
49
- "dev": "tsup src/index.ts src/client.ts src/plugin.ts src/schema.ts --format esm --dts --watch",
50
- "test": "vitest run",
51
- "typecheck": "tsc --noEmit",
52
- "lint": "eslint src/"
53
- },
54
47
  "peerDependencies": {
55
48
  "@better-auth/passkey": ">=1",
56
49
  "better-auth": ">=1",
@@ -58,7 +51,7 @@
58
51
  "react": ">=18"
59
52
  },
60
53
  "dependencies": {
61
- "@cfast/permissions": "workspace:*"
54
+ "@cfast/permissions": "0.1.0"
62
55
  },
63
56
  "devDependencies": {
64
57
  "@cloudflare/workers-types": "^4.20260305.1",
@@ -71,5 +64,12 @@
71
64
  "tsup": "^8",
72
65
  "typescript": "^5.7",
73
66
  "vitest": "^4.1.0"
67
+ },
68
+ "scripts": {
69
+ "build": "tsup src/index.ts src/client.ts src/plugin.ts src/schema.ts --format esm --dts",
70
+ "dev": "tsup src/index.ts src/client.ts src/plugin.ts src/schema.ts --format esm --dts --watch",
71
+ "test": "vitest run",
72
+ "typecheck": "tsc --noEmit",
73
+ "lint": "eslint src/"
74
74
  }
75
- }
75
+ }