@base44-preview/sdk 0.6.0-pr.23.76c21f3 → 0.6.1-dev.d43b559

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.js CHANGED
@@ -66,7 +66,7 @@ export function createClient(config) {
66
66
  const serviceRoleModules = {
67
67
  entities: createEntitiesModule(serviceRoleAxiosClient, appId),
68
68
  integrations: createIntegrationsModule(serviceRoleAxiosClient, appId),
69
- sso: createSsoModule(serviceRoleAxiosClient, appId, token, serviceToken),
69
+ sso: createSsoModule(serviceRoleAxiosClient, appId, token),
70
70
  functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId),
71
71
  };
72
72
  // Always try to get token from localStorage or URL parameters
@@ -52,6 +52,8 @@ export function createAuthModule(axios, functionsAxiosClient, appId) {
52
52
  if (typeof window !== "undefined" && window.localStorage) {
53
53
  try {
54
54
  window.localStorage.removeItem("base44_access_token");
55
+ // Remove "token" that is set by the built-in SDK of platform version 2
56
+ window.localStorage.removeItem("token");
55
57
  }
56
58
  catch (e) {
57
59
  console.error("Failed to remove token from localStorage:", e);
@@ -7,7 +7,7 @@ import { AxiosInstance } from "axios";
7
7
  * @param {string} [serviceToken] - Service role authentication token
8
8
  * @returns {Object} SSO module with SSO authentication methods
9
9
  */
10
- export declare function createSsoModule(axios: AxiosInstance, appId: string, userToken?: string, serviceToken?: string): {
10
+ export declare function createSsoModule(axios: AxiosInstance, appId: string, userToken?: string): {
11
11
  /**
12
12
  * Get current user sso access token
13
13
  * @param {string} userid - User ID to include as path parameter
@@ -6,7 +6,7 @@
6
6
  * @param {string} [serviceToken] - Service role authentication token
7
7
  * @returns {Object} SSO module with SSO authentication methods
8
8
  */
9
- export function createSsoModule(axios, appId, userToken, serviceToken) {
9
+ export function createSsoModule(axios, appId, userToken) {
10
10
  return {
11
11
  /**
12
12
  * Get current user sso access token
@@ -18,10 +18,7 @@ export function createSsoModule(axios, appId, userToken, serviceToken) {
18
18
  // Prepare headers with both tokens if available
19
19
  const headers = {};
20
20
  if (userToken) {
21
- headers['Authorization'] = `Bearer ${userToken}`;
22
- }
23
- if (serviceToken) {
24
- headers['Base44-Service-Authorization'] = `Bearer ${serviceToken}`;
21
+ headers['on-behalf-of'] = `Bearer ${userToken}`;
25
22
  }
26
23
  return axios.get(url, { headers });
27
24
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.6.0-pr.23.76c21f3",
3
+ "version": "0.6.1-dev.d43b559",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",