Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async makeRevokeTokenRequest(requestContext: ClientRequestContext): Promise {
requestContext.enter();
if (!this._configuration)
throw new BentleyError(AuthStatus.Error, "Not initialized. First call initialize()", Logger.logError, loggerCategory);
if (!this._tokenResponse)
throw new BentleyError(AuthStatus.Error, "Missing refresh token. First call signIn() and ensure it's successful", Logger.logError, loggerCategory);
const request = new RevokeTokenRequest({ token: this._tokenResponse.refreshToken! });
await this._tokenHandler.performRevokeTokenRequest(this._configuration, request);
requestContext.enter();
this._tokenResponse = undefined;
Logger.logTrace(loggerCategory, "Authorization revoked, and removed access token");
this.onUserStateChanged.raiseEvent(undefined);
}
}