diff --git a/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts b/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts index b9d184a4f6da27cbd6d1abd6330d0bb953a63ac2..b420e1a12170f6018bfa4cc8f64e4c66a85383b5 100644 --- a/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts +++ b/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts @@ -159,12 +159,12 @@ export default class KeycloakOAuth2DeviceFlowConnection { userAuthenticationRequestResponseCode = userAuthenticationRequestResponse.status; switch (userAuthenticationRequestResponseCode) { case HttpStatusCode.BAD_REQUEST: { - await this.handleCreateUserAuthenticationBadRequest(userAuthenticationRequestResponse); + await this.onUserAuthenticationFailure(userAuthenticationRequestResponse); break; } case HttpStatusCode.OK: { - await this.handleCreateUserAuthenticationSuccessRequest(userAuthenticationRequestResponse); + await this.onUserAuthenticationSuccess(userAuthenticationRequestResponse); break; } @@ -175,7 +175,7 @@ export default class KeycloakOAuth2DeviceFlowConnection { } } - private async handleCreateUserAuthenticationBadRequest(userAuthenticationRequestResponse: Response) { + private async onUserAuthenticationFailure(userAuthenticationRequestResponse: Response) { const badRequestResponse = (await userAuthenticationRequestResponse.json()) as FailedAuthenticationReponseData; const errorCode = TokenFetchErrorCode[badRequestResponse.error!]; switch (errorCode) { @@ -200,7 +200,7 @@ export default class KeycloakOAuth2DeviceFlowConnection { } } - private async handleCreateUserAuthenticationSuccessRequest(userAuthenticationRequestResponse: Response) { + private async onUserAuthenticationSuccess(userAuthenticationRequestResponse: Response) { const successRequestResponse = (await userAuthenticationRequestResponse.json()) as SuccessfulAuthenticationResponseData; this.accessToken = successRequestResponse.access_token ?? '';