@base44-preview/sdk 0.8.48-pr.282.86ef42a → 0.8.48-pr.282.8a4c1c0
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.
|
@@ -98,16 +98,11 @@ export interface AuthModuleOptions {
|
|
|
98
98
|
* which is how the server-side SDK reports a token it never sets explicitly.
|
|
99
99
|
*/
|
|
100
100
|
token?: string;
|
|
101
|
-
/**
|
|
102
|
-
* Whether this client runs embedded in a host platform's frame, where a
|
|
103
|
-
* session is minted by the platform and cannot be renewed by a login redirect.
|
|
104
|
-
*/
|
|
101
|
+
/** Whether a host platform embedded this client in a frame. */
|
|
105
102
|
embedded?: boolean;
|
|
106
103
|
/**
|
|
107
|
-
* Called
|
|
108
|
-
*
|
|
109
|
-
* the realtime socket, which carries a token on the handshake and so has to
|
|
110
|
-
* open a new connection to pick one up, or drop the one it has.
|
|
104
|
+
* Called when the identity changes: `true` on `setToken`, `false` on
|
|
105
|
+
* `logout`. Lets the client redial the socket, which holds its own copy.
|
|
111
106
|
*/
|
|
112
107
|
onSessionChange?: (hasSession: boolean) => void;
|
|
113
108
|
}
|
|
@@ -192,13 +187,13 @@ export interface AuthModule {
|
|
|
192
187
|
*/
|
|
193
188
|
redirectToLogin(nextUrl: string): void;
|
|
194
189
|
/**
|
|
195
|
-
* Whether
|
|
190
|
+
* Whether a host platform embedded this app and signed its user in.
|
|
196
191
|
*
|
|
197
|
-
*
|
|
192
|
+
* Only the platform can renew that session, so {@linkcode AuthModule.redirectToLogin | redirectToLogin()} and {@linkcode AuthModule.logout | logout()} show a "session ended" notice rather than a login page. Use this to render your own notice, or to hide sign-in controls that cannot work in the frame.
|
|
198
193
|
*
|
|
199
|
-
*
|
|
194
|
+
* The session lives in memory, so a reload inside the frame ends it and returns `false` here. Prefer client-side navigation.
|
|
200
195
|
*
|
|
201
|
-
* @returns `true` when
|
|
196
|
+
* @returns `true` when a host platform embedded this app.
|
|
202
197
|
*
|
|
203
198
|
* @example
|
|
204
199
|
* ```typescript
|
|
@@ -569,9 +564,6 @@ export interface InternalAuthModule extends AuthModule {
|
|
|
569
564
|
* could not succeed without a session, not to decide that one is valid.
|
|
570
565
|
*/
|
|
571
566
|
hasToken(): boolean;
|
|
572
|
-
/**
|
|
573
|
-
* The access token currently set on the client, or `null` when there is none.
|
|
574
|
-
* Follows {@linkcode AuthModule.setToken | setToken} and {@linkcode AuthModule.logout | logout}.
|
|
575
|
-
*/
|
|
567
|
+
/** The token currently set on the client, or `null`. */
|
|
576
568
|
getToken(): string | null;
|
|
577
569
|
}
|
|
@@ -40,6 +40,5 @@ export declare function createFetchWithAuth({ axios, serviceRoleAxios, appId, se
|
|
|
40
40
|
serverUrl: string;
|
|
41
41
|
functionsVersion?: string;
|
|
42
42
|
platformHeaders?: Record<string, string>;
|
|
43
|
-
/** Resolves once the client's session is settled. */
|
|
44
43
|
waitForAuth?: () => Promise<void>;
|
|
45
44
|
}): (path: string, init?: FetchWithAuthInit) => Promise<Response>;
|