@base44-preview/sdk 0.8.19-pr.134.8e9c74b → 0.8.19-pr.134.bf04bef

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.
@@ -1,4 +1,4 @@
1
- const POPUP_AUTH_DOMAIN_REGEX = /^(preview-sandbox--|preview--|checkpoint--)[^.]+\.base44\.app$/;
1
+ const POPUP_AUTH_DOMAIN_REGEX = /^(preview-sandbox--|preview--|checkpoint--)[^.]+\./;
2
2
  function isPopupAuthDomain() {
3
3
  if (typeof window === "undefined")
4
4
  return false;
@@ -84,9 +84,18 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
84
84
  loginWithProvider(provider, fromUrl = "/") {
85
85
  // Build the full redirect URL
86
86
  const redirectUrl = new URL(fromUrl, window.location.origin).toString();
87
- // Build the provider login URL (google is the default, so no provider path needed)
88
- const providerPath = provider === "google" ? "" : `/${provider}`;
89
- const loginUrl = `${options.appBaseUrl}/api/apps/auth${providerPath}/login?app_id=${appId}&from_url=${encodeURIComponent(redirectUrl)}`;
87
+ const queryParams = `app_id=${appId}&from_url=${encodeURIComponent(redirectUrl)}`;
88
+ // SSO uses a different URL structure with appId in the path
89
+ let authPath;
90
+ if (provider === "sso") {
91
+ authPath = `/apps/${appId}/auth/sso/login`;
92
+ }
93
+ else {
94
+ // Google is the default provider, so no provider path segment needed
95
+ const providerPath = provider === "google" ? "" : `/${provider}`;
96
+ authPath = `/apps/auth${providerPath}/login`;
97
+ }
98
+ const loginUrl = `${options.appBaseUrl}/api${authPath}?${queryParams}`;
90
99
  // On preview/sandbox/checkpoint domains the app runs inside an iframe —
91
100
  // use a popup to avoid OAuth providers blocking iframe navigation.
92
101
  if (isPopupAuthDomain()) {
@@ -185,8 +185,9 @@ export interface AuthModule {
185
185
  * - `'microsoft'` - {@link https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow | Microsoft OAuth}. Enable Microsoft in your app's authentication settings before specifying this provider.
186
186
  * - `'facebook'` - {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using.
187
187
  * - `'apple'` - {@link https://developer.apple.com/sign-in-with-apple/ | Sign in with Apple}. Enable Apple in your app's authentication settings before using this provider.
188
+ * - `'sso'` - Enterprise SSO. Enable SSO in your app's authentication settings before using this provider.
188
189
  *
189
- * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, or `'apple'`.
190
+ * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`.
190
191
  * @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`.
191
192
  *
192
193
  * @example
@@ -206,6 +207,12 @@ export interface AuthModule {
206
207
  * // Apple
207
208
  * base44.auth.loginWithProvider('apple', '/dashboard');
208
209
  * ```
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * // SSO
214
+ * base44.auth.loginWithProvider('sso', '/dashboard');
215
+ * ```
209
216
  */
210
217
  loginWithProvider(provider: string, fromUrl?: string): void;
211
218
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.19-pr.134.8e9c74b",
3
+ "version": "0.8.19-pr.134.bf04bef",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",