Skip to content

Commit d536be5

Browse files
committedApr 22, 2024
refactor(sdk)!: make resetAccessToken() sync
Change `MermaidChart#resetAccessToken()` so that it no longer returns a `Promise`.
1 parent 24055b2 commit d536be5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
 

‎packages/sdk/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
### Changes
9+
10+
- `MermaidChart#resetAccessToken()` no longer returns a `Promise`.
11+
812
## [0.2.0] - 2024-04-11
913

1014
### Added

‎packages/sdk/src/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ export class MermaidChart {
5757
this.axios.interceptors.response.use((res: AxiosResponse) => {
5858
// Reset token if a 401 is thrown
5959
if (res.status === 401) {
60-
// don't care if this function rejects/resolves
61-
void this.resetAccessToken();
60+
this.resetAccessToken();
6261
}
6362
return res;
6463
});
@@ -153,7 +152,7 @@ export class MermaidChart {
153152
this.accessToken = accessToken;
154153
}
155154

156-
public async resetAccessToken(): Promise<void> {
155+
public resetAccessToken(): void {
157156
this.accessToken = undefined;
158157
this.axios.defaults.headers.common['Authorization'] = `Bearer none`;
159158
}

0 commit comments

Comments
 (0)
Failed to load comments.