@eduzz/miau-client 1.4.0-rc.155 → 1.4.0-rc.157
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/MiauClient.d.ts +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/MiauClient.ts +24 -3
package/dist/MiauClient.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class MiauClient {
|
|
|
14
14
|
constructor(config: MiauClientConfig);
|
|
15
15
|
getEnvironment(): SecretEnv;
|
|
16
16
|
getPublicKey(kid: string): Promise<string>;
|
|
17
|
-
getToken(): Promise<string
|
|
17
|
+
getToken(): Promise<string>;
|
|
18
18
|
getTokenData: () => Promise<MiauClientToken>;
|
|
19
19
|
middleware<T = Record<string, string>>(config?: {
|
|
20
20
|
requestAugmentation?: RequestAugmentation<T, Request>;
|
package/dist/index.js
CHANGED
|
@@ -12074,9 +12074,12 @@ var MiauClient = class {
|
|
|
12074
12074
|
});
|
|
12075
12075
|
const data = await response.json();
|
|
12076
12076
|
if (response.status !== 200) {
|
|
12077
|
-
|
|
12077
|
+
const errorData = data;
|
|
12078
|
+
const errorMessage = errorData.message || errorData.error_description || `OAuth error: ${errorData.error}` || "Failed to fetch JWT token";
|
|
12079
|
+
throw new Error(errorMessage);
|
|
12078
12080
|
}
|
|
12079
|
-
|
|
12081
|
+
const successData = data;
|
|
12082
|
+
this.jwtToken = successData.access_token;
|
|
12080
12083
|
return this.jwtToken;
|
|
12081
12084
|
}
|
|
12082
12085
|
middleware(config) {
|