Removed migration of CS Token
MODIFY
src/server/ocpp/json/web-socket/JsonWSConnection.ts
src/server/ocpp/json/web-socket/JsonWSConnection.ts
@@ -70,7 +70,8 @@ export default class JsonWSConnection extends WSConnection {
if (typeof this.chargingStationService[methodName] === 'function') {
this.headers.currentIPAddress = this.getClientIP();
// Check the Charging Station
- const { tenant, chargingStation, token } = await OCPPUtils.checkAndGetChargingStationConnectionData(OCPPUtils.buildServerActionFromOcppCommand(command),
+ const { tenant, chargingStation, token } = await OCPPUtils.checkAndGetChargingStationConnectionData(
+ OCPPUtils.buildServerActionFromOcppCommand(command),
this.getTenantID(), this.getChargingStationID(), this.getTokenID());
// Set the header
this.headers.tenant = tenant;

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -1261,11 +1261,9 @@ export default class OCPPUtils {
message: 'Charging Station does not exist!'
});
}
- } else {
- // Update the DB (Migration for existing charging stations)
- if (!chargingStation.tokenID) {
- chargingStation.tokenID = tokenID;
+ return { tenant, token };
}
+ // Same Token?
if (chargingStation.tokenID !== tokenID) {
// Must have a valid connection Token
token = await OCPPUtils.ensureChargingStationHasValidConnectionToken(action, tenant, chargingStationID, tokenID);
@@ -1308,7 +1306,6 @@ export default class OCPPUtils {
cloudHostIP: chargingStation.cloudHostIP,
cloudHostName: chargingStation.cloudHostName,
});
- }
return { tenant, chargingStation, token };
}

Removed migration of CS Token