From 026fff46d3ab4c48830aed383a426eb2a6155590 Mon Sep 17 00:00:00 2001
From: Christian Zheng <czheng@takima.fr>
Date: Wed, 27 Apr 2022 13:44:44 +0200
Subject: [PATCH] refactor(login): rename private methods

---
 .../src/core/keycloakOAuth2DeviceFlowConnection.ts        | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts b/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts
index b9d184a4..b420e1a1 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 ?? '';
-- 
GitLab