@multiplatform.one/keycloak 6.7.0 → 7.1.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.
Files changed (79) hide show
  1. package/dist/cjs/index.cjs +129 -55
  2. package/dist/cjs/index.native.cjs +239 -130
  3. package/dist/esm/index.js +131 -57
  4. package/dist/esm/index.native.js +239 -130
  5. package/package.json +15 -10
  6. package/src/betterAuth/expoAuthFlow.native.spec.ts +307 -0
  7. package/src/betterAuth/expoAuthFlow.native.ts +189 -55
  8. package/src/frappeToken.native.spec.ts +104 -0
  9. package/src/frappeToken.native.ts +46 -2
  10. package/src/frappeToken.spec.ts +141 -0
  11. package/src/frappeToken.ts +106 -14
  12. package/src/index.ts +1 -1
  13. package/src/keycloak/index.ts +24 -7
  14. package/src/keycloak/index.webext.ts +16 -0
  15. package/src/oauth/authorizationUrl.spec.ts +83 -0
  16. package/src/oauth/authorizationUrl.ts +74 -0
  17. package/src/oauth/callback.spec.ts +72 -0
  18. package/src/oauth/callback.ts +46 -0
  19. package/src/oauth/callbackPage.spec.ts +61 -0
  20. package/src/oauth/callbackPage.ts +57 -0
  21. package/src/oauth/endpoints.spec.ts +193 -0
  22. package/src/oauth/endpoints.ts +135 -0
  23. package/src/oauth/errors.ts +18 -0
  24. package/src/oauth/form.spec.ts +35 -0
  25. package/src/oauth/form.ts +30 -0
  26. package/src/oauth/idToken.spec.ts +191 -0
  27. package/src/oauth/idToken.ts +153 -0
  28. package/src/oauth/index.ts +10 -0
  29. package/src/oauth/jwt.ts +90 -0
  30. package/src/oauth/loopbackFlow.spec.ts +226 -0
  31. package/src/oauth/loopbackFlow.ts +114 -0
  32. package/src/oauth/pkce.spec.ts +60 -0
  33. package/src/oauth/pkce.ts +80 -0
  34. package/src/oauth/tokenExchange.spec.ts +331 -0
  35. package/src/oauth/tokenExchange.ts +232 -0
  36. package/src/one.ts +30 -3
  37. package/src/provider/AfterAuth.tsx +7 -0
  38. package/src/provider/authProvider/index.native.tsx +37 -4
  39. package/src/session/index.ts +2 -2
  40. package/src/state.ts +5 -2
  41. package/types/betterAuth/expoAuthFlow.native.d.ts +50 -3
  42. package/types/betterAuth/expoAuthFlow.native.d.ts.map +1 -1
  43. package/types/frappeToken.d.ts +14 -1
  44. package/types/frappeToken.d.ts.map +1 -1
  45. package/types/frappeToken.native.d.ts +16 -2
  46. package/types/frappeToken.native.d.ts.map +1 -1
  47. package/types/index.d.ts +1 -1
  48. package/types/index.d.ts.map +1 -1
  49. package/types/keycloak/index.d.ts.map +1 -1
  50. package/types/keycloak/index.webext.d.ts.map +1 -1
  51. package/types/oauth/authorizationUrl.d.ts +32 -0
  52. package/types/oauth/authorizationUrl.d.ts.map +1 -0
  53. package/types/oauth/callback.d.ts +26 -0
  54. package/types/oauth/callback.d.ts.map +1 -0
  55. package/types/oauth/callbackPage.d.ts +34 -0
  56. package/types/oauth/callbackPage.d.ts.map +1 -0
  57. package/types/oauth/endpoints.d.ts +68 -0
  58. package/types/oauth/endpoints.d.ts.map +1 -0
  59. package/types/oauth/errors.d.ts +17 -0
  60. package/types/oauth/errors.d.ts.map +1 -0
  61. package/types/oauth/form.d.ts +16 -0
  62. package/types/oauth/form.d.ts.map +1 -0
  63. package/types/oauth/idToken.d.ts +83 -0
  64. package/types/oauth/idToken.d.ts.map +1 -0
  65. package/types/oauth/index.d.ts +11 -0
  66. package/types/oauth/index.d.ts.map +1 -0
  67. package/types/oauth/jwt.d.ts +31 -0
  68. package/types/oauth/jwt.d.ts.map +1 -0
  69. package/types/oauth/loopbackFlow.d.ts +64 -0
  70. package/types/oauth/loopbackFlow.d.ts.map +1 -0
  71. package/types/oauth/pkce.d.ts +49 -0
  72. package/types/oauth/pkce.d.ts.map +1 -0
  73. package/types/oauth/tokenExchange.d.ts +89 -0
  74. package/types/oauth/tokenExchange.d.ts.map +1 -0
  75. package/types/one.d.ts +7 -0
  76. package/types/one.d.ts.map +1 -1
  77. package/types/provider/AfterAuth.d.ts.map +1 -1
  78. package/types/provider/authProvider/index.native.d.ts.map +1 -1
  79. package/types/state.d.ts.map +1 -1
@@ -0,0 +1,31 @@
1
+ /**
2
+ * File: /src/oauth/jwt.ts
3
+ * Project: @multiplatform.one/keycloak
4
+ *
5
+ * Unverified JWT decoding — the inverse of pkce.ts's base64url encoder, and
6
+ * hand-rolled for the same reason: GJS has no `atob` and no `Buffer`, and the
7
+ * OAuth core has to run unchanged on GJS, node and the browser.
8
+ *
9
+ * "Unverified" is load-bearing. Nothing in this file looks at the signature.
10
+ * Decoding a JWT tells you what the bytes claim, not whether the claim is
11
+ * true; `validateIdToken` in idToken.ts is what turns the former into the
12
+ * latter, and it is the only thing that should be feeding these results into
13
+ * a decision.
14
+ */
15
+ /**
16
+ * base64url per RFC 4648 §5 — URL-safe alphabet, padding optional.
17
+ *
18
+ * Strict on input: an unknown character or a 1-character tail (which no
19
+ * base64 encoding can produce) is a malformed token, not something to
20
+ * silently round down.
21
+ */
22
+ export declare function base64UrlDecode(value: string): Uint8Array;
23
+ export interface DecodedJwt {
24
+ header: Record<string, unknown>;
25
+ payload: Record<string, unknown>;
26
+ /** Present so a caller can see there is one; nothing here verifies it. */
27
+ signature: string;
28
+ }
29
+ /** Decode a compact-serialization JWS without verifying anything about it. */
30
+ export declare function decodeJwt(token: string): DecodedJwt;
31
+ //# sourceMappingURL=jwt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../src/oauth/jwt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CA2BzD;AAeD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAUnD"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * File: /src/oauth/loopbackFlow.ts
3
+ * Project: @multiplatform.one/keycloak
4
+ *
5
+ * Authorization Code + PKCE with a loopback redirect — the flow RFC 8252
6
+ * ("OAuth 2.0 for Native Apps", §7.3) prescribes for desktop applications.
7
+ *
8
+ * The app binds an ephemeral port on 127.0.0.1, hands Keycloak that port as
9
+ * the redirect URI, and opens the system browser. The user authenticates in a
10
+ * real browser — with their password manager, their existing SSO cookie and a
11
+ * verifiable address bar — and Keycloak redirects back to the listener, which
12
+ * closes as soon as the code arrives.
13
+ *
14
+ * Why not the alternatives:
15
+ *
16
+ * - A custom URI scheme (`myapp://callback`) needs an installed .desktop
17
+ * file registering `x-scheme-handler/myapp` plus a desktop-database
18
+ * refresh. That cannot work from a dev tree run with `gjs -m dist/...`,
19
+ * and on a multi-app desktop any other app can register the same scheme.
20
+ * - The device authorization grant avoids the redirect entirely, but it has
21
+ * to be enabled per-client on the realm, and it downgrades the UX to
22
+ * retyping a code for a GUI app that can perfectly well open a browser.
23
+ * - An embedded webview would put the app between the user and their
24
+ * credentials, which RFC 8252 §8.12 explicitly rules out.
25
+ *
26
+ * Everything the flow touches is injected, so the whole orchestration is
27
+ * exercised in unit tests with no browser, no sockets and no GJS.
28
+ */
29
+ import { type CallbackQuery } from "./callback";
30
+ import { type PkceCrypto } from "./pkce";
31
+ import { type FetchLike, type TokenSet } from "./tokenExchange";
32
+ /** A bound loopback socket waiting for exactly one redirect. */
33
+ export interface LoopbackListener {
34
+ /** The `http://127.0.0.1:<port>/…` URI the socket is bound to. */
35
+ redirectUri: string;
36
+ waitForCallback(): Promise<CallbackQuery>;
37
+ close(): void;
38
+ }
39
+ export interface LoopbackTransport {
40
+ crypto: PkceCrypto;
41
+ fetch: FetchLike;
42
+ openBrowser(url: string): void | Promise<void>;
43
+ /**
44
+ * Bind a loopback socket for one login.
45
+ *
46
+ * `expectedState` is handed over at bind time rather than at wait time so
47
+ * the listener can tell the real redirect from a stray local request from
48
+ * the very first packet — there is no window in which it does not yet know
49
+ * what it is waiting for.
50
+ */
51
+ listen(expectedState: string): Promise<LoopbackListener>;
52
+ }
53
+ export interface LoopbackLoginConfig {
54
+ url: string;
55
+ realm: string;
56
+ clientId: string;
57
+ /** See `RealmLocation.allowInsecureLoopbackHttp` — development only. */
58
+ allowInsecureLoopbackHttp?: boolean;
59
+ scopes?: string[];
60
+ prompt?: "none" | "login" | "consent" | "select_account";
61
+ loginHint?: string;
62
+ }
63
+ export declare function runLoopbackLogin(transport: LoopbackTransport, config: LoopbackLoginConfig): Promise<TokenSet>;
64
+ //# sourceMappingURL=loopbackFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loopbackFlow.d.ts","sourceRoot":"","sources":["../../src/oauth/loopbackFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,YAAY,CAAC;AAG5E,OAAO,EAAiD,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACxF,OAAO,EAA6B,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3F,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1C,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C;;;;;;;OAOG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,gBAAgB,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,QAAQ,CAAC,CAwCnB"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * File: /src/oauth/pkce.ts
3
+ * Project: @multiplatform.one/keycloak
4
+ *
5
+ * PKCE (RFC 7636) for public clients. A desktop app cannot keep a client
6
+ * secret, so the code verifier is what proves the app redeeming the
7
+ * authorization code is the same app that requested it.
8
+ *
9
+ * Crypto is injected rather than imported: the browser has WebCrypto, GJS has
10
+ * GLib.compute_checksum_for_bytes, and neither is reachable from the other.
11
+ * Keeping the primitive behind an interface is also what makes this file
12
+ * testable with fixed vectors.
13
+ */
14
+ export interface PkceCrypto {
15
+ /** Cryptographically secure random bytes. */
16
+ randomBytes(length: number): Uint8Array;
17
+ /** Raw (not hex) SHA-256 digest. */
18
+ sha256(input: Uint8Array): Uint8Array;
19
+ }
20
+ export interface PkcePair {
21
+ verifier: string;
22
+ challenge: string;
23
+ method: "S256";
24
+ }
25
+ /**
26
+ * base64url per RFC 4648 §5 — no padding, URL-safe alphabet.
27
+ *
28
+ * Hand-rolled rather than btoa/Buffer because this runs on all three of
29
+ * browsers, node (tests) and GJS, and GJS has neither of those globals.
30
+ */
31
+ export declare function base64UrlEncode(bytes: Uint8Array): string;
32
+ /**
33
+ * RFC 7636 §4.1 allows a 43–128 char verifier; 32 random bytes base64url-encode
34
+ * to 43 chars, the shortest length the spec considers secure.
35
+ */
36
+ export declare function createPkcePair(crypto: PkceCrypto): PkcePair;
37
+ /** Opaque CSRF token echoed back on the redirect (RFC 6749 §10.12). */
38
+ export declare function createStateToken(crypto: Pick<PkceCrypto, "randomBytes">): string;
39
+ /**
40
+ * Replay defence for the ID token (OIDC Core §3.1.2.1). Sent on the
41
+ * authorization request and echoed in the id_token's `nonce` claim, so a
42
+ * token captured from one login cannot be presented as the result of another.
43
+ *
44
+ * Separate from the state token on purpose: state binds the *redirect* to
45
+ * this process, nonce binds the *token* to this authorization request, and
46
+ * reusing one value for both would leak the state into the token.
47
+ */
48
+ export declare function createNonce(crypto: Pick<PkceCrypto, "randomBytes">): string;
49
+ //# sourceMappingURL=pkce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkce.d.ts","sourceRoot":"","sources":["../../src/oauth/pkce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IACxC,oCAAoC;IACpC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;CACvC;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAgBzD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAI3D;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,CAE3E"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * File: /src/oauth/tokenExchange.ts
3
+ * Project: @multiplatform.one/keycloak
4
+ *
5
+ * The token endpoint calls, written against a minimal fetch shape so the GJS
6
+ * libsoup fetch shim satisfies it as readily as the platform fetch.
7
+ *
8
+ * This module is also where every ID token this package produces gets
9
+ * validated. Doing it here rather than in the flow is what makes the
10
+ * invariant checkable: a `TokenSet` whose `idToken` is set has had that token
11
+ * validated against the issuer and this client, because there is no other way
12
+ * to construct one — `toTokenSet` is module-private and `TokenSet` is branded,
13
+ * so a consumer cannot object-literal its way past the validation either. It
14
+ * is also the only place OIDC Core §3.1.3.7's "directly from the Token
15
+ * Endpoint" precondition is provably true — see idToken.ts for what that
16
+ * precondition buys and what it does not.
17
+ */
18
+ import type { OidcEndpoints } from "./endpoints";
19
+ import { type IdTokenClaims } from "./idToken";
20
+ export interface FetchLikeResponse {
21
+ ok: boolean;
22
+ status: number;
23
+ json(): Promise<unknown>;
24
+ text(): Promise<string>;
25
+ }
26
+ export type FetchLike = (url: string, init: {
27
+ method: string;
28
+ headers: Record<string, string>;
29
+ body: string;
30
+ }) => Promise<FetchLikeResponse>;
31
+ declare const tokenSetBrand: unique symbol;
32
+ export interface TokenSet {
33
+ /**
34
+ * Phantom brand — in the type, never on the object. It is what makes the
35
+ * invariant above checkable rather than merely stated: an object literal
36
+ * cannot satisfy this interface, so the only `TokenSet` that exists is one
37
+ * `toTokenSet` returned, and `toTokenSet` cannot return without having put
38
+ * any `idToken` through `validateIdToken` first.
39
+ */
40
+ readonly [tokenSetBrand]: true;
41
+ accessToken: string;
42
+ /**
43
+ * Present only when it passed `validateIdToken` — `iss`, `aud`, `azp`,
44
+ * `exp` and (on the authorization-code grant) `nonce` have all been
45
+ * checked. Its signature has not been verified; see idToken.ts for why
46
+ * that is sound here and what would break it.
47
+ */
48
+ idToken?: string;
49
+ /** Claims of the validated `idToken`, so callers need not re-decode it. */
50
+ idTokenClaims?: IdTokenClaims;
51
+ refreshToken?: string;
52
+ /** Access token lifetime in seconds, as reported by the server. */
53
+ expiresIn?: number;
54
+ refreshExpiresIn?: number;
55
+ tokenType?: string;
56
+ scope?: string;
57
+ }
58
+ export interface ExchangeCodeParams {
59
+ endpoints: OidcEndpoints;
60
+ clientId: string;
61
+ code: string;
62
+ codeVerifier: string;
63
+ redirectUri: string;
64
+ /**
65
+ * The nonce from the authorization request this code came back on.
66
+ * Required, not optional: it is the only thing binding the returned ID
67
+ * token to this login, and an optional parameter is one a caller forgets.
68
+ */
69
+ nonce: string;
70
+ /** Epoch seconds for the `exp`/`iat` checks. Injected by tests. */
71
+ now?: number;
72
+ }
73
+ export declare function exchangeAuthorizationCode(fetchImpl: FetchLike, { endpoints, clientId, code, codeVerifier, redirectUri, nonce, now }: ExchangeCodeParams): Promise<TokenSet>;
74
+ export interface RefreshParams {
75
+ endpoints: OidcEndpoints;
76
+ clientId: string;
77
+ refreshToken: string;
78
+ /** Epoch seconds for the `exp`/`iat` checks. Injected by tests. */
79
+ now?: number;
80
+ }
81
+ export declare function refreshAccessToken(fetchImpl: FetchLike, { endpoints, clientId, refreshToken, now }: RefreshParams): Promise<TokenSet>;
82
+ /**
83
+ * End the Keycloak SSO session via back-channel logout. Preferred over opening
84
+ * the end-session URL in a browser on GNOME: there is no app window to return
85
+ * to, so a browser tab would just be left sitting on a logout page.
86
+ */
87
+ export declare function endSession(fetchImpl: FetchLike, { endpoints, clientId, refreshToken }: RefreshParams): Promise<void>;
88
+ export {};
89
+ //# sourceMappingURL=tokenExchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenExchange.d.ts","sourceRoot":"","sources":["../../src/oauth/tokenExchange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,KAAK,aAAa,E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yBAAyB,CAC7C,SAAS,EAAE,SAAS,EACpB,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,kBAAkB,GACvF,OAAO,CAAC,QAAQ,CAAC,CAuBnB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,aAAa,GACxD,OAAO,CAAC,QAAQ,CAAC,CAWnB;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,SAAS,EACpB,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,aAAa,GACnD,OAAO,CAAC,IAAI,CAAC,CAWf"}
package/types/one.d.ts CHANGED
@@ -23,6 +23,13 @@ export interface AuthHandlerConfig {
23
23
  scopes?: string[];
24
24
  /** Expo deep-link scheme (e.g. "multiplatform-one") — added to trustedOrigins. */
25
25
  expoScheme?: string;
26
+ /**
27
+ * Additional origins allowed to hit the auth route (e.g. LAN device
28
+ * origins). Extends — never replaces — the defaults (baseUrl, keycloak
29
+ * URL, expo scheme). Also readable from the KEYCLOAK_TRUSTED_ORIGINS env
30
+ * var as a comma-separated list.
31
+ */
32
+ trustedOrigins?: string[];
26
33
  }
27
34
  export type Auth = ReturnType<typeof createAuth>;
28
35
  //# sourceMappingURL=one.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../src/one.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,wBAAgB,UAAU,CAAC,MAAM,EAAE,iBAAiB,mCA+CnD;AAED,M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AAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AfterAuth.d.ts","sourceRoot":"","sources":["../../src/provider/AfterAuth.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAK9E,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,gBAAgB,CAAC,EAAE,aAAa,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,EAAE,cAAc,2CAwD1F"}
1
+ {"version":3,"file":"AfterAuth.d.ts","sourceRoot":"","sources":["../../src/provider/AfterAuth.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAM9E,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,gBAAgB,CAAC,EAAE,aAAa,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,EAAE,cAAc,2CA8D1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/provider/authProvider/index.native.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,gBAAgB,GACjB,EAAE,iBAAiB,2CA6FnB"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/provider/authProvider/index.native.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAiBH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,gBAAgB,GACjB,EAAE,iBAAiB,2CAyHnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,SAAmD,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc;IAC/C,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC1F;AAOD,wBAAgB,YAAY,IAAI,SAAS,CAUxC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,SAAwC,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc;IAC/C,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IA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