create-prisma-php-app 5.0.0-alpha.28 → 5.0.0-alpha.29
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.
|
@@ -26,6 +26,18 @@
|
|
|
26
26
|
- Use `--tag <value>` or `--tag=<value>` for release-channel or pinned-version updates.
|
|
27
27
|
- Do not use `npx pp update project` as a substitute for Prisma ORM migration commands.
|
|
28
28
|
|
|
29
|
+
## Authentication Route Strategy
|
|
30
|
+
|
|
31
|
+
- Prisma PHP defaults to public routes.
|
|
32
|
+
- Choose the route privacy strategy at the start of the app, before creating most routes.
|
|
33
|
+
- If the app will have many public pages, keep the public-default strategy.
|
|
34
|
+
- If the app will have only a few public entry points and most routes should require login, use the private-default strategy.
|
|
35
|
+
- For private-default routing, enable both `IS_ALL_ROUTES_PRIVATE = true` and `IS_TOKEN_AUTO_REFRESH = true` in `src/Lib/Auth/AuthConfig.php`.
|
|
36
|
+
- When `IS_ALL_ROUTES_PRIVATE` is `true`, Prisma PHP treats routes as private by default and uses `publicRoutes` for the public allowlist; home is already public by default because `publicRoutes` starts as `['/']`.
|
|
37
|
+
- Keep `authRoutes` public by default unless the user explicitly asks to change them.
|
|
38
|
+
- There is no need to modify other Prisma PHP core files for this route privacy behavior.
|
|
39
|
+
- If `src/Lib/Auth/AuthConfig.php` is customized, preserve it during future Prisma PHP project updates by adding `./src/Lib/Auth/AuthConfig.php` to `excludeFiles` in `prisma-php.json`.
|
|
40
|
+
|
|
29
41
|
## PulsePoint-First Frontend Rules
|
|
30
42
|
|
|
31
43
|
- In full-stack Prisma PHP apps, treat PulsePoint as the primary JavaScript authoring model for frontend behavior.
|
package/dist/AGENTS.md
CHANGED
|
@@ -408,6 +408,14 @@ Important auth rules:
|
|
|
408
408
|
|
|
409
409
|
- route privacy strategy is configured from `AuthConfig.php`
|
|
410
410
|
- Prisma PHP supports both public-default and private-default route protection strategies
|
|
411
|
+
- Prisma PHP defaults to public routes, so keep the public-default strategy when the app will expose many public pages
|
|
412
|
+
- choose the route privacy strategy early, ideally before creating most routes in a new app or route subtree
|
|
413
|
+
- if the app will have only a few public entry points and most routes should require login, switch to the private-default strategy
|
|
414
|
+
- when choosing private-default routing, enable both `AuthConfig::IS_ALL_ROUTES_PRIVATE` and `AuthConfig::IS_TOKEN_AUTO_REFRESH`
|
|
415
|
+
- when `IS_ALL_ROUTES_PRIVATE` is `true`, keep public exceptions in `AuthConfig::$publicRoutes`; home remains public by default because it starts as `['/']`
|
|
416
|
+
- keep `AuthConfig::$authRoutes` public by default unless the user explicitly wants a different auth route allowlist
|
|
417
|
+
- there is no need to modify other Prisma PHP core files to enable private-default routing
|
|
418
|
+
- if `src/Lib/Auth/AuthConfig.php` was customized, protect it from future project updates by adding `./src/Lib/Auth/AuthConfig.php` to `excludeFiles` in `prisma-php.json`
|
|
411
419
|
- sign users in with `Auth::getInstance()->signIn(...)`
|
|
412
420
|
- sign users out with `Auth::getInstance()->signOut(...)`
|
|
413
421
|
- use `Auth::getInstance()->refreshUserSession(...)` when current-session auth payloads must be updated after role or profile changes
|
|
@@ -700,6 +708,7 @@ Important rules:
|
|
|
700
708
|
|
|
701
709
|
- update `prisma-php.json` before assuming a feature is active in a consumer app
|
|
702
710
|
- do not assume Tailwind, Prisma, Swagger, WebSocket, MCP, or TypeScript support is enabled unless `prisma-php.json` says so
|
|
711
|
+
- keep customized framework-managed files such as `src/Lib/Auth/AuthConfig.php` in `excludeFiles` when you need project updates to preserve them
|
|
703
712
|
- after changing feature flags, follow the documented project update flow
|
|
704
713
|
- for AI-driven or scripted updates, prefer `npx pp update project -y`
|
|
705
714
|
|