Remove the creation of the inactive tag
MODIFY
src/assets/server/notification/email/en/unknown-user-badged.json
src/assets/server/notification/email/en/unknown-user-badged.json
"",
"An unknown user has just badged on <strong>'<%- chargeBoxID %>'</strong> with the badge ID <strong>'<%- badgeID %>'</strong>."
],
- "actions": [{
- "title": "Edit Badge",
- "url": "<%- evseDashboardTagURL %>"
- }],
"afterActionLines": [
"Best Regards,",
"EV Admins."

MODIFY
src/assets/server/notification/email/es/unknown-user-badged.json
src/assets/server/notification/email/es/unknown-user-badged.json
"",
"Un usuario desconocido acaba de conectarse a <strong> '<%- chargeBoxID%>' </strong> con el ID de la insignia <strong> '<%- badgeID%>' </strong>."
],
- "actions": [{
- "title": "Editar Insignia",
- "url": "<%- evseDashboardTagURL %>"
- }],
"afterActionLines": [
"Atentamente,",
"EV Admins."

MODIFY
src/assets/server/notification/email/fr/unknown-user-badged.json
src/assets/server/notification/email/fr/unknown-user-badged.json
"",
"Un utilisateur inconnu vient juste de badger sur <strong>'<%- chargeBoxID %>'</strong> avec le badge ID <strong>'<%- badgeID %>'</strong>."
],
- "actions": [{
- "title": "Editer Badge",
- "url": "<%- evseDashboardTagURL %>"
- }],
"afterActionLines": [
"Cordialement,",
"EV Admins."

MODIFY
src/assets/server/notification/email/it/unknown-user-badged.json
src/assets/server/notification/email/it/unknown-user-badged.json
"",
"Un utente sconosciuto ha appena usato un badge su <strong>'<%- chargeBoxID %>'</strong> con ID Badge <strong>'<%- badgeID %>'</strong>."
],
- "actions": [{
- "title": "Modifica Badge",
- "url": "<%- evseDashboardTagURL %>"
- }],
"afterActionLines": [
"Cordiali Saluti,",
"Amministratori EV."

MODIFY
src/authorization/Authorizations.ts
src/authorization/Authorizations.ts
@@ -788,7 +788,7 @@ export default class Authorizations {
return { user };
}
// Create the Tag as inactive and abort
- await this.createInactiveTagAndAbortAction(action, tenant, tagID, chargingStation);
+ this.notifyUnknownBadgeHasBeenUsedAndAbort(action, tenant, tagID, chargingStation);
}
// Get Authorized User
const user = await this.checkAndGetAuthorizedUserFromTag(action, tenant, chargingStation, transaction, tag, authAction);
@@ -972,7 +972,7 @@ export default class Authorizations {
return user;
}
- private static async createInactiveTagAndAbortAction(
+ private static notifyUnknownBadgeHasBeenUsedAndAbort(
action: ServerAction, tenant: Tenant, tagID: string, chargingStation: ChargingStation) {
const tag: Tag = {
id: tagID,
@@ -982,8 +982,6 @@ export default class Authorizations {
createdOn: new Date(),
default: false
};
- // Save
- await TagStorage.saveTag(tenant, tag);
// Notify (Async)
NotificationHandler.sendUnknownUserBadged(
tenant,
@@ -993,14 +991,13 @@ export default class Authorizations {
chargeBoxID: chargingStation.id,
badgeID: tagID,
evseDashboardURL: Utils.buildEvseURL(tenant.subdomain),
- evseDashboardTagURL: Utils.buildEvseTagURL(tenant.subdomain, tag)
}
).catch(() => { });
throw new BackendError({
source: chargingStation.id,
action: action,
- module: MODULE_NAME, method: 'createAndGetInactiveTag',
- message: `Tag ID '${tagID}' is unknown and has been created successfully as an inactive Tag`,
+ module: MODULE_NAME, method: 'notifyUnknownBadgeHasBeenUsedAndAbort',
+ message: `Tag ID '${tagID}' is unknown`,
detailedMessages: { tag }
});
}

MODIFY
src/types/UserNotifications.ts
src/types/UserNotifications.ts
@@ -201,7 +201,6 @@ export interface UnknownUserBadgedNotification extends BaseNotification {
chargeBoxID: string;
badgeID: string;
evseDashboardURL: string;
- evseDashboardTagURL: string;
}
export interface TransactionStartedNotification extends BaseNotification {

Remove the creation of the inactive tag