@base44-preview/sdk 0.8.39-pr.234.288f036 → 0.8.39-pr.234.45b6d41
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.
|
@@ -114,6 +114,7 @@ export interface AppUserConnectorConnectionResponse {
|
|
|
114
114
|
* | Slack Bot | `slackbot` |
|
|
115
115
|
* | Snowflake | `snowflake` |
|
|
116
116
|
* | Splitwise | `splitwise` |
|
|
117
|
+
* | Square | `square` |
|
|
117
118
|
* | Supabase | `supabase` |
|
|
118
119
|
* | TikTok | `tiktok` |
|
|
119
120
|
* | Typeform | `typeform` |
|
package/dist/modules/sso.d.ts
CHANGED
package/dist/modules/sso.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param axios - Axios instance
|
|
5
5
|
* @param appId - Application ID
|
|
6
|
-
* @param userToken - User authentication token
|
|
7
6
|
* @returns SSO module with authentication methods
|
|
8
7
|
* @internal
|
|
9
8
|
*/
|
|
@@ -17,8 +16,7 @@ export function createSsoModule(axios, appId) {
|
|
|
17
16
|
// Get the stored SSO OIDC ID token for a specific user
|
|
18
17
|
async getIdToken(userid) {
|
|
19
18
|
const url = `/apps/${appId}/auth/sso/idtoken/${userid}`;
|
|
20
|
-
|
|
21
|
-
return response;
|
|
19
|
+
return axios.get(url);
|
|
22
20
|
},
|
|
23
21
|
};
|
|
24
22
|
}
|
|
@@ -18,15 +18,9 @@ export interface SsoAccessTokenResponse {
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* const base44 = createClientFromRequest(req);
|
|
25
|
-
* const user = await base44.auth.me();
|
|
26
|
-
* const idToken = await base44.asServiceRole.sso.getIdToken(user.id);
|
|
27
|
-
*
|
|
28
|
-
* return Response.json({ idToken });
|
|
29
|
-
* });
|
|
21
|
+
* // Access SSO module with service role
|
|
22
|
+
* const response = await base44.asServiceRole.sso.getAccessToken('user_123');
|
|
23
|
+
* console.log(response.data.access_token);
|
|
30
24
|
* ```
|
|
31
25
|
*/
|
|
32
26
|
export interface SsoModule {
|
|
@@ -56,6 +50,19 @@ export interface SsoModule {
|
|
|
56
50
|
*
|
|
57
51
|
* @param userid - The current app user's ID.
|
|
58
52
|
* @returns Promise resolving to the raw ID-token string.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { createClientFromRequest } from 'npm:@base44/sdk';
|
|
57
|
+
*
|
|
58
|
+
* Deno.serve(async (req) => {
|
|
59
|
+
* const base44 = createClientFromRequest(req);
|
|
60
|
+
* const user = await base44.auth.me();
|
|
61
|
+
* const idToken = await base44.asServiceRole.sso.getIdToken(user.id);
|
|
62
|
+
*
|
|
63
|
+
* return Response.json({ idToken });
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
59
66
|
*/
|
|
60
67
|
getIdToken(userid: string): Promise<string>;
|
|
61
68
|
}
|