Fix default link and redirection in install controller

This commit is contained in:
ArthurHoaro 2020-07-24 10:30:47 +02:00
parent 8e9169ceba
commit 87ae3c4f08
2 changed files with 4 additions and 4 deletions

View file

@ -128,7 +128,7 @@ class InstallController extends ShaarliVisitorController
$this->container->conf->get('credentials.salt') $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 { try {
// Everything is ok, let's create config file. // 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!')] [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 protected function checkPermissions(): bool

View file

@ -236,7 +236,7 @@ class InstallControllerTest extends TestCase
$result = $this->controller->save($request, $response); $result = $this->controller->save($request, $response);
static::assertSame(302, $result->getStatusCode()); 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); $result = $this->controller->save($request, $response);
static::assertSame(302, $result->getStatusCode()); 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('UTC', $confSettings['general.timezone']);
static::assertSame('Shared bookmarks on http://shaarli', $confSettings['general.title']); static::assertSame('Shared bookmarks on http://shaarli', $confSettings['general.title']);