Skip to content

Commit

Permalink
Ensure access token is cleared on each configure()
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Jan 21, 2025
2 parents 8ba84ec + 612ed1b commit 8de5da2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/authgear-capacitor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export class CapacitorContainer {
this.clientID = options.clientID;
this.baseContainer.apiClient.endpoint = options.endpoint;
this.baseContainer.refreshToken = refreshToken ?? undefined;
this.baseContainer.accessToken = undefined;

if (this.baseContainer.refreshToken != null) {
// consider user as logged in if refresh token is available
Expand Down
1 change: 1 addition & 0 deletions packages/authgear-react-native/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ export class ReactNativeContainer {
this.clientID = options.clientID;
this.baseContainer.apiClient.endpoint = options.endpoint;
this.baseContainer.refreshToken = refreshToken ?? undefined;
this.baseContainer.accessToken = undefined;

if (this.baseContainer.refreshToken != null) {
// consider user as logged in if refresh token is available
Expand Down
1 change: 1 addition & 0 deletions packages/authgear-web/src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export class WebContainer {
// and the previously stored refresh token is loaded.
const refreshToken = await this.tokenStorage.getRefreshToken(this.name);
this.baseContainer.refreshToken = refreshToken ?? undefined;
this.baseContainer.accessToken = undefined;

if (this.baseContainer.refreshToken != null) {
// consider user as logged in if refresh token is available
Expand Down

0 comments on commit 8de5da2

Please sign in to comment.