File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { createAxiosClient } from "./utils/axios-client.js";
22import { createEntitiesModule } from "./modules/entities.js" ;
33import { createIntegrationsModule } from "./modules/integrations.js" ;
44import { createAuthModule } from "./modules/auth.js" ;
5+ import { createSsoModule } from "./modules/sso.js" ;
56import { getAccessToken } from "./utils/auth-utils.js" ;
67import { createFunctionsModule } from "./modules/functions.js" ;
78
@@ -84,6 +85,7 @@ export function createClient(config: {
8485 const serviceRoleModules = {
8586 entities : createEntitiesModule ( serviceRoleAxiosClient , appId ) ,
8687 integrations : createIntegrationsModule ( serviceRoleAxiosClient , appId ) ,
88+ sso : createSsoModule ( serviceRoleAxiosClient , appId ) ,
8789 functions : createFunctionsModule ( serviceRoleFunctionsAxiosClient , appId ) ,
8890 } ;
8991
Original file line number Diff line number Diff line change @@ -20,14 +20,6 @@ export function createAuthModule(
2020 async me ( ) {
2121 return axios . get ( `/apps/${ appId } /entities/User/me` ) ;
2222 } ,
23- /**
24- * Get current user sso access token
25- * @returns {Promise<Object> } Current user sso access_token
26- */
27- async getSsoAccessToken ( ) {
28- return axios . get ( `/apps/${ appId } /auth/sso/accesstoken` ) ;
29- } ,
30-
3123 /**
3224 * Update current user data
3325 * @param {Object } data - Updated user data
Original file line number Diff line number Diff line change 1+ import { AxiosInstance } from "axios" ;
2+
3+ /**
4+ * Creates the SSO module for the Base44 SDK
5+ * @param {import('axios').AxiosInstance } axios - Axios instance
6+ * @param {string } appId - Application ID
7+ * @returns {Object } SSO module with SSO authentication methods
8+ */
9+ export function createSsoModule (
10+ axios : AxiosInstance ,
11+ appId : string
12+ ) {
13+ return {
14+ /**
15+ * Get current user sso access token
16+ * @param {string } userid - User ID to include as path parameter
17+ * @returns {Promise<Object> } Current user sso access_token
18+ */
19+ async getAccessToken ( userid : string ) {
20+ const url = `/apps/${ appId } /auth/sso/accesstoken/${ userid } ` ;
21+ return axios . get ( url ) ;
22+ } ,
23+ } ;
24+ }
You can’t perform that action at this time.
0 commit comments