@base44-preview/sdk 0.7.2-pr.30.982623a → 0.7.3-pr.30.2bc2a1c
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/dist/client.d.ts +1 -0
- package/dist/client.js +2 -1
- package/dist/modules/auth.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -18,7 +18,7 @@ import { RoomsSocket } from "./utils/socket-utils.js";
|
|
|
18
18
|
* @returns {Object} Base44 client instance
|
|
19
19
|
*/
|
|
20
20
|
export function createClient(config) {
|
|
21
|
-
const { serverUrl = "https://base44.app", appId, token, serviceToken, requiresAuth = false, options, functionsVersion, onRedirectToLogin, } = config;
|
|
21
|
+
const { serverUrl = "https://base44.app", appId, token, serviceToken, requiresAuth = false, options, functionsVersion, onRedirectToLogin, headers: optionalHeaders, } = config;
|
|
22
22
|
const socketConfig = {
|
|
23
23
|
serverUrl,
|
|
24
24
|
mountPath: "/ws-user-apps/socket.io/",
|
|
@@ -30,6 +30,7 @@ export function createClient(config) {
|
|
|
30
30
|
config: socketConfig,
|
|
31
31
|
});
|
|
32
32
|
const headers = {
|
|
33
|
+
...optionalHeaders,
|
|
33
34
|
"X-App-Id": String(appId),
|
|
34
35
|
};
|
|
35
36
|
const functionHeaders = functionsVersion
|
package/dist/modules/auth.js
CHANGED
|
@@ -39,7 +39,7 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
|
|
|
39
39
|
// If nextUrl is not provided, use the current URL
|
|
40
40
|
const redirectUrl = nextUrl || window.location.href;
|
|
41
41
|
// Build the login URL
|
|
42
|
-
const loginUrl = `${options.serverUrl}/login?from_url=${encodeURIComponent(redirectUrl)}`;
|
|
42
|
+
const loginUrl = `${options.serverUrl}/login?from_url=${encodeURIComponent(redirectUrl)}&app_id=${appId}`;
|
|
43
43
|
// Redirect to the login page
|
|
44
44
|
window.location.href = loginUrl;
|
|
45
45
|
},
|