5 description => "Add syspref TwoFactorAuthentication, fields secret and auth_method",
8 my ($dbh, $out) = @$args{qw(dbh out)};
11 INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
12 ('TwoFactorAuthentication', '0', 'NULL', 'Enables two-factor authentication', 'YesNo')
15 if( !column_exists( 'borrowers', 'secret' ) ) {
17 ALTER TABLE borrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password`
21 if( !column_exists( 'deletedborrowers', 'secret' ) ) {
23 ALTER TABLE deletedborrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password`
27 if( !column_exists( 'borrowers', 'auth_method' ) ) {
29 ALTER TABLE borrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret`
33 if( !column_exists( 'deletedborrowers', 'auth_method' ) ) {
35 ALTER TABLE deletedborrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret`