]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1312 from wallabag/v2-fix-1311
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 12 Aug 2015 11:21:16 +0000 (13:21 +0200)
committerJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 12 Aug 2015 11:21:16 +0000 (13:21 +0200)
fix #1311, redirect after login

app/config/security.yml
src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php

index 37236d403a92d27e0d489be7db47310fb9966af5..acc86984703aed69afcff7334f28e894bf2f9fe8 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 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();