@eduzz/miau-client 1.4.0-rc.145 → 1.4.0-rc.146

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eduzz/miau-client",
3
- "version": "1.4.0-rc.145",
3
+ "version": "1.4.0-rc.146",
4
4
  "description": "Eduzz Miau Client",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/src/MiauClient.ts CHANGED
@@ -65,7 +65,7 @@ export class MiauClient {
65
65
  }
66
66
  }
67
67
 
68
- const response = await fetch(this.getApiJwtUrl(), {
68
+ const response = await fetch(this.getOAuthTokenUrl(), {
69
69
  headers: {
70
70
  'Authorization': `Basic ${this.basicAuthToken}`,
71
71
  'Content-Type': 'application/json'
@@ -78,7 +78,7 @@ export class MiauClient {
78
78
  throw new Error(data.message || 'Failed to fetch JWT token');
79
79
  }
80
80
 
81
- this.jwtToken = data.jwt;
81
+ this.jwtToken = data.access_token;
82
82
  return this.jwtToken;
83
83
  }
84
84
 
@@ -120,10 +120,6 @@ export class MiauClient {
120
120
  return jwt.verify(token, publicKey, { algorithms: ['RS256'] }) as MiauClientToken;
121
121
  }
122
122
 
123
- private getApiJwtUrl = () => {
124
- return `${this.config.apiUrl}/v1/jwt`;
125
- };
126
-
127
123
  private getJwksUrl = () => {
128
124
  return `${this.config.apiUrl}/v1/jwks.json`;
129
125
  };
@@ -131,4 +127,8 @@ export class MiauClient {
131
127
  private getHasPermissionUrl = () => {
132
128
  return `${this.config.apiUrl}/v1/has-permission`;
133
129
  };
130
+
131
+ private getOAuthTokenUrl = () => {
132
+ return `${this.config.apiUrl}/v1/oauth/token`;
133
+ };
134
134
  }