Skip to content

Commit

Permalink
Merge pull request #205 from yathindrakodithuwakku/fix-clear-user-ses…
Browse files Browse the repository at this point in the history
…sion

Replace handleSignOutSuccessful with clearUserSessionData
  • Loading branch information
yasinmiran authored May 3, 2022
2 parents 5dfdcdd + eaba16d commit ed1ba7b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class AsgardeoAuthClient<T> {
private _authenticationCore: AuthenticationCore<T>;

private static _instanceID: number;
static _authenticationCore: any;

/**
* This is the constructor method that returns an instance of the .
Expand All @@ -84,6 +85,7 @@ export class AsgardeoAuthClient<T> {
}
this._dataLayer = new DataLayer<T>(`instance_${AsgardeoAuthClient._instanceID}`, store);
this._authenticationCore = new AuthenticationCore(this._dataLayer, cryptoUtils);
AsgardeoAuthClient._authenticationCore = new AuthenticationCore(this._dataLayer, cryptoUtils);
}

/**
Expand Down Expand Up @@ -570,12 +572,6 @@ export class AsgardeoAuthClient<T> {
return stateParam ? stateParam === SIGN_OUT_SUCCESS_PARAM && !error : false;
}

public async handleSignOutSuccessful(signOutRedirectURL: string, userID?: string) {
if(AsgardeoAuthClient.isSignOutSuccessful(signOutRedirectURL)) {
await this._authenticationCore.clearUserSessionData(userID);
}
}

/**
* This method returns if the sign-out has failed or not.
*
Expand Down Expand Up @@ -624,4 +620,8 @@ export class AsgardeoAuthClient<T> {
public async updateConfig(config: Partial<AuthClientConfig<T>>): Promise<void> {
await this._authenticationCore.updateConfig(config);
}

public static async clearUserSessionData(userID?: string): Promise<void> {
await this._authenticationCore.clearUserSessionData(userID);
}
}

0 comments on commit ed1ba7b

Please sign in to comment.