]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #3615 from notFloran/3612-login-by-email
authorJérémy Benoist <j0k3r@users.noreply.github.com>
Tue, 3 Apr 2018 20:08:42 +0000 (22:08 +0200)
committerGitHub <noreply@github.com>
Tue, 3 Apr 2018 20:08:42 +0000 (22:08 +0200)
Allow login by email

app/config/security.yml
tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php

index 796dc361e1ea202e67cd3f610f283f81502d1020..02afc9eaaa1f96d31b23e00f3cff61bc2b38cbf3 100644 (file)
@@ -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
index 2cf596d46734eb43b8ecd327a61611ceff039a50..395208a2fe263b3cfe977e03ad5271250f8ce016 100644 (file)
@@ -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());
     }
 }