@base44-preview/sdk 0.8.19-pr.131.ff1af44 → 0.8.19-pr.133.511000e

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,9 +37,18 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
37
37
  loginWithProvider(provider, fromUrl = "/") {
38
38
  // Build the full redirect URL
39
39
  const redirectUrl = new URL(fromUrl, window.location.origin).toString();
40
- // Build the provider login URL (google is the default, so no provider path needed)
41
- const providerPath = provider === "google" ? "" : `/${provider}`;
42
- const loginUrl = `${options.appBaseUrl}/api/apps/auth${providerPath}/login?app_id=${appId}&from_url=${encodeURIComponent(redirectUrl)}`;
40
+ const queryParams = `app_id=${appId}&from_url=${encodeURIComponent(redirectUrl)}`;
41
+ // SSO uses a different URL structure with appId in the path
42
+ let authPath;
43
+ if (provider === "sso") {
44
+ authPath = `/apps/${appId}/auth/sso/login`;
45
+ }
46
+ else {
47
+ // Google is the default provider, so no provider path segment needed
48
+ const providerPath = provider === "google" ? "" : `/${provider}`;
49
+ authPath = `/apps/auth${providerPath}/login`;
50
+ }
51
+ const loginUrl = `${options.appBaseUrl}/api${authPath}?${queryParams}`;
43
52
  // Redirect to the provider login page
44
53
  window.location.href = loginUrl;
45
54
  },
@@ -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.131.ff1af44",
3
+ "version": "0.8.19-pr.133.511000e",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",