@base44/sdk 0.7.8 → 0.7.10

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.
@@ -37,7 +37,9 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
37
37
  return;
38
38
  }
39
39
  // If nextUrl is not provided, use the current URL
40
- const redirectUrl = nextUrl || window.location.href;
40
+ const redirectUrl = nextUrl
41
+ ? new URL(nextUrl, window.location.origin).toString()
42
+ : window.location.href;
41
43
  // Build the login URL
42
44
  const loginUrl = `${options.serverUrl}/login?from_url=${encodeURIComponent(redirectUrl)}&app_id=${appId}`;
43
45
  // Redirect to the login page
@@ -90,6 +92,8 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
90
92
  window.localStorage) {
91
93
  try {
92
94
  window.localStorage.setItem("base44_access_token", token);
95
+ // Set "token" that is set by the built-in SDK of platform version 2
96
+ window.localStorage.setItem("token", token);
93
97
  }
94
98
  catch (e) {
95
99
  console.error("Failed to save token to localStorage:", e);
@@ -65,6 +65,8 @@ export function saveAccessToken(token, options) {
65
65
  }
66
66
  try {
67
67
  window.localStorage.setItem(storageKey, token);
68
+ // Set "token" that is set by the built-in SDK of platform version 2
69
+ window.localStorage.setItem("token", token);
68
70
  return true;
69
71
  }
70
72
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44/sdk",
3
- "version": "0.7.8",
3
+ "version": "0.7.10",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",