aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/DoctrineMigrations/Version20181202073750.php22
-rw-r--r--app/config/config.yml3
2 files changed, 23 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20181202073750.php b/app/DoctrineMigrations/Version20181202073750.php
index a2308b99..b6ad8bd7 100644
--- a/app/DoctrineMigrations/Version20181202073750.php
+++ b/app/DoctrineMigrations/Version20181202073750.php
@@ -12,11 +12,29 @@ final class Version20181202073750 extends WallabagMigration
12{ 12{
13 public function up(Schema $schema): void 13 public function up(Schema $schema): void
14 { 14 {
15 $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL, CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL, DROP trusted'); 15 $tableName = $this->getTable('annotation');
16
17 switch ($this->connection->getDatabasePlatform()->getName()) {
18 case 'sqlite':
19 break;
20 case 'mysql':
21 $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL, CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL, DROP trusted, ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
22 break;
23 case 'postgresql':
24 break;
25 }
16 } 26 }
17 27
18 public function down(Schema $schema): void 28 public function down(Schema $schema): void
19 { 29 {
20 $this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret, CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL, ADD trusted TEXT DEFAULT NULL'); 30 switch ($this->connection->getDatabasePlatform()->getName()) {
31 case 'sqlite':
32 break;
33 case 'mysql':
34 $this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret, CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL, ADD trusted TEXT DEFAULT NULL, DROP backupCodes');
35 break;
36 case 'postgresql':
37 break;
38 }
21 } 39 }
22} 40}
diff --git a/app/config/config.yml b/app/config/config.yml
index 908f53b7..2d8f9bf0 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -203,6 +203,9 @@ scheb_two_factor:
203 cookie_name: wllbg_trusted_computer 203 cookie_name: wllbg_trusted_computer
204 lifetime: 2592000 204 lifetime: 2592000
205 205
206 backup_codes:
207 enabled: "%twofactor_auth%"
208
206 google: 209 google:
207 enabled: "%twofactor_auth%" 210 enabled: "%twofactor_auth%"
208 template: WallabagUserBundle:Authentication:form.html.twig 211 template: WallabagUserBundle:Authentication:form.html.twig