Skip to content

Commit 58c1e19

Browse files
authored
Merge pull request #20280 from mozilla/FXA-13351
fix(auth): Add missing security event name to db
2 parents 17f0bbd + d45ee9c commit 58c1e19

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SET NAMES utf8mb4 COLLATE utf8mb4_bin;
2+
3+
CALL assertPatchLevel('186');
4+
5+
INSERT INTO securityEventNames(name) VALUES ('account.recovery_codes_set');
6+
7+
UPDATE dbMetadata SET value = '187' WHERE name = 'schema-patch-level';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- SET NAMES utf8mb4 COLLATE utf8mb4_bin;
2+
3+
-- DELETE FROM securityEventNames WHERE name = 'account.recovery_codes_set';
4+
5+
-- UPDATE dbMetadata SET value = '186' WHERE name = 'schema-patch-level';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"level": 186
2+
"level": 187
33
}

packages/fxa-shared/db/models/auth/security-event.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { convertError } from '../../mysql';
1111
// These are the values of the `securityEventNames` table in the fxa DB. The
1212
// numeric id is a MySQL auto_increment'd value. It's best to run the
1313
// migrations and then add the id values here when adding more event types.
14-
export const EVENT_NAMES: Record<string, number> = {
14+
export const EVENT_NAMES = {
1515
'account.create': 1,
1616
'account.login': 2,
1717
'account.reset': 3,
@@ -76,7 +76,8 @@ export const EVENT_NAMES: Record<string, number> = {
7676
'account.passwordless_login_otp_failed': 57,
7777
'account.passwordless_login_otp_verified': 58,
7878
'account.passwordless_registration_complete': 59,
79-
} as const;
79+
'account.recovery_codes_set': 60,
80+
} as const satisfies Record<string, number>;
8081

8182
export type SecurityEventNames = keyof typeof EVENT_NAMES;
8283

0 commit comments

Comments
 (0)