create-bcp-app 0.2.4 → 0.2.5
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 +29 -3
- package/package.json +1 -1
- package/template/README.md +28 -0
package/README.md
CHANGED
|
@@ -92,10 +92,10 @@ Example:
|
|
|
92
92
|
"schemaVersion": 1,
|
|
93
93
|
"framework": "bcp",
|
|
94
94
|
"projectName": "my-app",
|
|
95
|
-
"frameworkPackage": "npm:@chidchanun/bcp@0.2.
|
|
95
|
+
"frameworkPackage": "npm:@chidchanun/bcp@0.2.5",
|
|
96
96
|
"createdWith": {
|
|
97
97
|
"package": "create-bcp-app",
|
|
98
|
-
"version": "0.2.
|
|
98
|
+
"version": "0.2.5"
|
|
99
99
|
},
|
|
100
100
|
"packageManager": "npm",
|
|
101
101
|
"presets": {
|
|
@@ -277,6 +277,32 @@ Set this to a cryptographically random secret of at least 32 bytes before real a
|
|
|
277
277
|
|
|
278
278
|
The generated `authenticateCredentials(email, password)` returns `null` until the application connects it to its own user store and password-hash verification.
|
|
279
279
|
|
|
280
|
+
Generated auth stays in backward-compatible stateless JWT-cookie mode by default.
|
|
281
|
+
|
|
282
|
+
BCP `0.2.5+` can opt into revocable server-side auth state without changing the generated auth route structure:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
import {
|
|
286
|
+
createAuth,
|
|
287
|
+
createMemoryAuthSessionStore,
|
|
288
|
+
} from "bcp/auth";
|
|
289
|
+
|
|
290
|
+
const sessionStore =
|
|
291
|
+
createMemoryAuthSessionStore();
|
|
292
|
+
|
|
293
|
+
const frameworkAuth =
|
|
294
|
+
createAuth<AuthenticatedUser>({
|
|
295
|
+
store:
|
|
296
|
+
sessionStore,
|
|
297
|
+
idleTimeout:
|
|
298
|
+
60 * 30,
|
|
299
|
+
});
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
The memory store is intended for development/tests. Multi-process production deployments should implement `AuthSessionStore` using shared durable storage.
|
|
303
|
+
|
|
304
|
+
Authentication Platform v2 also provides `logoutAll()`, session/user revocation APIs and `createGuestGuard()` for login/register pages.
|
|
305
|
+
|
|
280
306
|
## Application Packaging — 0.2.4+
|
|
281
307
|
|
|
282
308
|
Generated projects include:
|
|
@@ -368,5 +394,5 @@ npx create-bcp-app my-app --yes
|
|
|
368
394
|
The `--bcp` option is mainly for prerelease/local package verification:
|
|
369
395
|
|
|
370
396
|
```bash
|
|
371
|
-
npx create-bcp-app my-app --bcp file:../chidchanun-bcp-0.2.
|
|
397
|
+
npx create-bcp-app my-app --bcp file:../chidchanun-bcp-0.2.5.tgz
|
|
372
398
|
```
|
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -39,6 +39,34 @@ It records non-secret scaffold choices such as Tailwind, database, authenticatio
|
|
|
39
39
|
|
|
40
40
|
Commit this file with the project. Do not put passwords, access keys, session secrets or tokens in it.
|
|
41
41
|
|
|
42
|
+
## Authentication — BCP 0.2.5+
|
|
43
|
+
|
|
44
|
+
Projects created with the `JWT Cookie` preset remain stateless by default and use the generated `lib/auth.ts` helpers.
|
|
45
|
+
|
|
46
|
+
BCP Authentication Platform v2 can opt into revocable server-side session state:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import {
|
|
50
|
+
createAuth,
|
|
51
|
+
createMemoryAuthSessionStore,
|
|
52
|
+
} from "bcp/auth";
|
|
53
|
+
|
|
54
|
+
const sessionStore =
|
|
55
|
+
createMemoryAuthSessionStore();
|
|
56
|
+
|
|
57
|
+
export const appAuth =
|
|
58
|
+
createAuth({
|
|
59
|
+
store:
|
|
60
|
+
sessionStore,
|
|
61
|
+
idleTimeout:
|
|
62
|
+
60 * 30,
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The memory store is intended for local development/tests. Use a shared durable `AuthSessionStore` implementation for multi-process or multi-container production deployments.
|
|
67
|
+
|
|
68
|
+
Authentication Platform v2 also provides session revocation, `logoutAll()`, rotation with revocation, and `createGuestGuard()` for guest-only pages such as login/register routes.
|
|
69
|
+
|
|
42
70
|
## Generate framework files
|
|
43
71
|
|
|
44
72
|
BCP can generate common project files:
|