]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fix default link and redirection in install controller
authorArthurHoaro <arthur@hoa.ro>
Fri, 24 Jul 2020 08:30:47 +0000 (10:30 +0200)
committerArthurHoaro <arthur@hoa.ro>
Fri, 24 Jul 2020 08:30:47 +0000 (10:30 +0200)
application/front/controller/visitor/InstallController.php
tests/front/controller/visitor/InstallControllerTest.php

index 94ebb4ae2e30bfc8320cc0d272c972f93eb10c31..5e3152c7b6ab52951d28db67b90cdb2ddf801500 100644 (file)
@@ -128,7 +128,7 @@ class InstallController extends ShaarliVisitorController
                 $this->container->conf->get('credentials.salt')
             )
         );
-        $this->container->conf->set('general.header_link', $this->container->basePath);
+        $this->container->conf->set('general.header_link', $this->container->basePath . '/');
 
         try {
             // Everything is ok, let's create config file.
@@ -149,7 +149,7 @@ class InstallController extends ShaarliVisitorController
             [t('Shaarli is now configured. Please login and start shaaring your bookmarks!')]
         );
 
-        return $this->redirect($response, '/');
+        return $this->redirect($response, '/login');
     }
 
     protected function checkPermissions(): bool
index 29c4d7a04ba7f10465efd4a3e39271b0e8d473e3..089c64acd05a8c0b2fc663efa5cda41612aa328f 100644 (file)
@@ -236,7 +236,7 @@ class InstallControllerTest extends TestCase
         $result = $this->controller->save($request, $response);
 
         static::assertSame(302, $result->getStatusCode());
-        static::assertSame('/subfolder/', $result->getHeader('location')[0]);
+        static::assertSame('/subfolder/login', $result->getHeader('location')[0]);
     }
 
     /**
@@ -257,7 +257,7 @@ class InstallControllerTest extends TestCase
         $result = $this->controller->save($request, $response);
 
         static::assertSame(302, $result->getStatusCode());
-        static::assertSame('/subfolder/', $result->getHeader('location')[0]);
+        static::assertSame('/subfolder/login', $result->getHeader('location')[0]);
 
         static::assertSame('UTC', $confSettings['general.timezone']);
         static::assertSame('Shared bookmarks on http://shaarli', $confSettings['general.title']);