@bigso/auth-sdk 0.5.4 → 0.5.5
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.
- package/dist/node/index.cjs +5 -2
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +5 -2
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -108,10 +108,13 @@ var BigsoSsoClient = class {
|
|
|
108
108
|
}
|
|
109
109
|
return await response.json();
|
|
110
110
|
}
|
|
111
|
-
async refreshTokens() {
|
|
111
|
+
async refreshTokens(refreshToken) {
|
|
112
|
+
const headers = { "Content-Type": "application/json" };
|
|
113
|
+
const body = refreshToken ? JSON.stringify({ refreshToken }) : void 0;
|
|
112
114
|
const response = await fetch(`${this.ssoBackendUrl}/api/v2/auth/refresh`, {
|
|
113
115
|
method: "POST",
|
|
114
|
-
headers
|
|
116
|
+
headers,
|
|
117
|
+
body,
|
|
115
118
|
credentials: "include"
|
|
116
119
|
});
|
|
117
120
|
if (!response.ok) {
|
package/dist/node/index.d.cts
CHANGED
|
@@ -14,7 +14,7 @@ declare class BigsoSsoClient {
|
|
|
14
14
|
validateAccessToken(accessToken: string): Promise<SsoTokenPayload | null>;
|
|
15
15
|
login(emailOrNuid: string, password: string): Promise<V2LoginResponse>;
|
|
16
16
|
exchangeCode(code: string, codeVerifier: string): Promise<V2ExchangeResponse>;
|
|
17
|
-
refreshTokens(): Promise<V2RefreshResponse>;
|
|
17
|
+
refreshTokens(refreshToken?: string): Promise<V2RefreshResponse>;
|
|
18
18
|
logout(accessToken: string, revokeAll?: boolean): Promise<void>;
|
|
19
19
|
}
|
|
20
20
|
|
package/dist/node/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare class BigsoSsoClient {
|
|
|
14
14
|
validateAccessToken(accessToken: string): Promise<SsoTokenPayload | null>;
|
|
15
15
|
login(emailOrNuid: string, password: string): Promise<V2LoginResponse>;
|
|
16
16
|
exchangeCode(code: string, codeVerifier: string): Promise<V2ExchangeResponse>;
|
|
17
|
-
refreshTokens(): Promise<V2RefreshResponse>;
|
|
17
|
+
refreshTokens(refreshToken?: string): Promise<V2RefreshResponse>;
|
|
18
18
|
logout(accessToken: string, revokeAll?: boolean): Promise<void>;
|
|
19
19
|
}
|
|
20
20
|
|
package/dist/node/index.js
CHANGED
|
@@ -58,10 +58,13 @@ var BigsoSsoClient = class {
|
|
|
58
58
|
}
|
|
59
59
|
return await response.json();
|
|
60
60
|
}
|
|
61
|
-
async refreshTokens() {
|
|
61
|
+
async refreshTokens(refreshToken) {
|
|
62
|
+
const headers = { "Content-Type": "application/json" };
|
|
63
|
+
const body = refreshToken ? JSON.stringify({ refreshToken }) : void 0;
|
|
62
64
|
const response = await fetch(`${this.ssoBackendUrl}/api/v2/auth/refresh`, {
|
|
63
65
|
method: "POST",
|
|
64
|
-
headers
|
|
66
|
+
headers,
|
|
67
|
+
body,
|
|
65
68
|
credentials: "include"
|
|
66
69
|
});
|
|
67
70
|
if (!response.ok) {
|