aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-12-03 06:51:06 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-01-23 13:28:03 +0100
commitdfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba (patch)
tree112b4403052b0420804dc8a7bcba199f534d902e /app
parent6e4fc956abc909232044e7af0fa37cbb1b510f18 (diff)
downloadwallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.tar.gz
wallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.tar.zst
wallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.zip
Add backup codes
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