@aiquants/auth-react-router 0.35.0 → 0.36.0
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 +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -552,7 +552,7 @@ package's own `react: ">=18"`; a host that mounts `/admin` must satisfy the stri
|
|
|
552
552
|
without its `=` padding, 43 characters, 43 to 129 once URL-encoded. React Router 7 and 8 sign the same way, and the package's
|
|
553
553
|
tests pin the name and the shape. Change `cookieName`, the default name or the signing scheme only together with every such
|
|
554
554
|
proxy's rule: a mismatch raises no error anywhere, the proxy just stops recognising the browser.
|
|
555
|
-
- **Verify order**: Google profile check → `backendAuth.verify` → allowlist → `backendAuth.signup` (every login). Failures redirect to `<loginPath>?error=<encoded error message>` (messages overridable via `messages`).
|
|
555
|
+
- **Verify order**: Google profile check → `backendAuth.verify` → allowlist → `backendAuth.signup` (every login). Failures redirect to `<loginPath>?error=<encoded error message>` (messages overridable via `messages`; a key that `AuthMessages` lacks, or a text that is not a non-blank string, throws a `RangeError` when `createGoogleAuthenticator` builds the authenticator).
|
|
556
556
|
- **Token refresh**: expiry check → Google `oauth2/v4/token` rotate → session update; `invalid_grant` destroys the session and redirects to login with `Set-Cookie`.
|
|
557
557
|
- **Loader guard**: `authenticateInLoader(request, { failureRedirect })` returns `{ user, cookie? }` with `user` **required** when `failureRedirect` is a string (any authentication failure throws a redirect), and `{ user?, cookie? }` when it is `null` (no-redirect mode). Passing `""` throws a `TypeError` before any work — it is a mistake, not a request for the default.
|
|
558
558
|
- **One authentication per request**: the guard performs its work at most once per `Request` instance and shares a mode-neutral result, so a root loader (`null`) and a leaf loader (`"/auth/login"`) in the same React Router data pass share a single pass — one warmup, one token refresh, one `Set-Cookie`. The failure policy is applied per caller on top of the shared result, so it must never be part of the cache key.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/auth-react-router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "React Router v7 / v8 auth adapter for @aiquants/auth-core: Google OAuth strategy factory (remix-auth), cookie session storage with DI test backdoor, a loader guard that authenticates at most once per request (token refresh + photo cache), auth route handlers, and a <GoogleForm> login button.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"tailwind-variants": "^3.2.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@aiquants/auth-core": "0.
|
|
58
|
-
"@aiquants/console-ui": "0.6.
|
|
57
|
+
"@aiquants/auth-core": "0.8.0",
|
|
58
|
+
"@aiquants/console-ui": "0.6.4",
|
|
59
59
|
"@aiquants/fuzzy-search": "3.2.1",
|
|
60
60
|
"@aiquants/select-box": "0.22.1",
|
|
61
61
|
"@aiquants/virtualscroll": "3.24.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"vitest": "^4.1.8"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@aiquants/auth-core": "^0.
|
|
80
|
+
"@aiquants/auth-core": "^0.8.0",
|
|
81
81
|
"@aiquants/console-ui": "^0.6.0",
|
|
82
82
|
"@aiquants/fuzzy-search": "^3.2.1",
|
|
83
83
|
"@aiquants/select-box": "^0.22.0",
|