refactor: code cleanup
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 30 Jul 2023 20:42:32 +0000 (22:42 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 30 Jul 2023 20:42:32 +0000 (22:42 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts

index 2d4853f052db9ec1f44f7148d532d9218e9b86be..262f3b5305d94ebd43431732b090545c0ce42d96 100644 (file)
@@ -472,9 +472,9 @@ export class OCPP16ResponseService extends OCPPResponseService {
     const authorizeConnectorIdDefined = !isNullOrUndefined(authorizeConnectorId);
     if (payload.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) {
       if (authorizeConnectorIdDefined) {
-        chargingStation.getConnectorStatus(authorizeConnectorId!)!.idTagAuthorized = true;
         chargingStation.getConnectorStatus(authorizeConnectorId!)!.authorizeIdTag =
           requestPayload.idTag;
+        chargingStation.getConnectorStatus(authorizeConnectorId!)!.idTagAuthorized = true;
       }
       logger.debug(
         `${chargingStation.logPrefix()} idTag '${requestPayload.idTag}' accepted${