]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1323 from wallabag/v2-1302-checkbox
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 12 Aug 2015 11:23:52 +0000 (13:23 +0200)
committerJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 12 Aug 2015 11:23:52 +0000 (13:23 +0200)
fix #1302: add 'stay connected' checkbox

app/config/security.yml
src/Wallabag/CoreBundle/Resources/views/themes/material/Security/forgotPassword.html.twig
src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php

index 2163389be44b49aba4a6384f899d1c6f1f839f30..b9c4cbef2d55729ab3139da63756329a71b3b2e6 100644 (file)
@@ -37,9 +37,9 @@ security:
 
                 post_only:                      true
 
-                always_use_default_target_path: true
+                always_use_default_target_path: false
                 default_target_path:            /
-                target_path_parameter:          redirect_url
+                target_path_parameter:          _target_path
                 use_referer:                    true
 
                 failure_path:                   null
index 7d7fea6f3cde3d04395ecdd38153b69ba72a5e61..9750f8baee88bfd39593bd5a88f1eaf0b73d21fb 100644 (file)
@@ -43,6 +43,9 @@
                     {{ form_rest(form) }}
                 </form>
             </div>
+            <div class="center">
+                <a href="{{ path('login') }}">{% trans %}Back to login{% endtrans %}</a>
+            </div>
         </div>
     </main>
     <style>
@@ -53,4 +56,4 @@
 {% endblock %}
 
 {% block footer %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
index a51e836d1586c74659a5145175f59b35dff1a38e..759ef01b0417b2e63f88d984b95f2737e6ec749f 100644 (file)
@@ -40,6 +40,25 @@ class SecurityControllerTest extends WallabagCoreTestCase
         $this->assertContains('Bad credentials', $client->getResponse()->getContent());
     }
 
+    public function testRedirectionAfterLogin()
+    {
+        $client = $this->getClient();
+        $client->followRedirects();
+
+        $crawler = $client->request('GET', '/config');
+
+        $form = $crawler->filter('button[type=submit]')->form();
+
+        $data = array(
+            '_username' => 'admin',
+            '_password' => 'mypassword',
+        );
+
+        $client->submit($form, $data);
+
+        $this->assertContains('RSS', $client->getResponse()->getContent());
+    }
+
     public function testForgotPassword()
     {
         $client = $this->getClient();