@terpjs/contract 0.20.0 → 0.21.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/package.json +1 -1
- package/src/auth.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terpjs/contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Terp frontend contract \u2014 the OpenAPI-generated TypeScript client, design tokens, and the stack-agnostic module/route/nav + auth types.",
|
|
6
6
|
"exports": {
|
package/src/auth.ts
CHANGED
|
@@ -38,6 +38,17 @@ export interface AuthSession {
|
|
|
38
38
|
currentUser(): CurrentUser | null;
|
|
39
39
|
/** True while the provider is resolving an existing session (e.g. boot refresh). */
|
|
40
40
|
loading(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* True when the boot session check got no answer at all — the backend did not
|
|
43
|
+
* respond before the timeout, or the connection failed.
|
|
44
|
+
*
|
|
45
|
+
* Distinct from `currentUser() === null`, which is the *answer* "nobody is signed
|
|
46
|
+
* in". Collapsing the two is what made a dead backend indistinguishable from a
|
|
47
|
+
* signed-out visitor, and since the fetch to a dead proxy target never settles
|
|
48
|
+
* rather than failing, the symptom was a permanently blank page with nothing in the
|
|
49
|
+
* console. `RequireAuth` renders its `unreachable` slot on this.
|
|
50
|
+
*/
|
|
51
|
+
unreachable(): boolean;
|
|
41
52
|
/**
|
|
42
53
|
* UI gate: may the current user perform `action`? (Honours the backend roles.)
|
|
43
54
|
*
|