From 08d6bedcaaaeb29ddb416708aff75c54b40baa05 Mon Sep 17 00:00:00 2001 From: Floran Brutel Date: Wed, 28 Mar 2018 21:56:55 +0200 Subject: [PATCH] Allow login by email --- app/config/security.yml | 2 +- .../CoreBundle/Controller/SecurityControllerTest.php | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/config/security.yml b/app/config/security.yml index 796dc361..02afc9ea 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -12,7 +12,7 @@ security: class: WallabagUserBundle:User property: username fos_userbundle: - id: fos_user.user_provider.username + id: fos_user.user_provider.username_email # the main part of the security, where you can set up firewalls # for specific sections of your app diff --git a/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php b/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php index 2cf596d4..395208a2 100644 --- a/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php @@ -6,6 +6,16 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; class SecurityControllerTest extends WallabagCoreTestCase { + public function testLoginWithEmail() + { + $this->logInAsUsingHttp('bigboss@wallabag.org'); + $client = $this->getClient(); + $client->followRedirects(); + + $crawler = $client->request('GET', '/config'); + $this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(['_text'])[0]); + } + public function testLoginWithout2Factor() { $this->logInAs('admin'); @@ -81,7 +91,7 @@ class SecurityControllerTest extends WallabagCoreTestCase } $client->followRedirects(); - $crawler = $client->request('GET', '/register'); + $client->request('GET', '/register'); $this->assertContains('registration.submit', $client->getResponse()->getContent()); } } -- 2.41.0