@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.
@@ -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: { "Content-Type": "application/json" },
116
+ headers,
117
+ body,
115
118
  credentials: "include"
116
119
  });
117
120
  if (!response.ok) {
@@ -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
 
@@ -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
 
@@ -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: { "Content-Type": "application/json" },
66
+ headers,
67
+ body,
65
68
  credentials: "include"
66
69
  });
67
70
  if (!response.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigso/auth-sdk",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "SDK de autenticación para SSO v2 - JWT Bearer + PKCE",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",