Skip to content

Commit 13aaf22

Browse files
HesyRaspalax
authored andcommitted
Redirect everything but homepage (#37)
1 parent fce4359 commit 13aaf22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Module.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ public function onDispatch(MvcEvent $event)
7575
->setHost(null)
7676
->setPort(null)
7777
->setUserInfo(null);
78-
$redirectUrl = $uri->toString();
78+
79+
$redirectUrl = null;
80+
if( $uri->toString() !== '/') {
81+
$redirectUrl = $uri->toString();
82+
}
83+
7984

8085
// Redirect the user to the "Login" page.
8186
return $controller->redirect()->toRoute('login', [], ['query' => ['redirectUrl' => $redirectUrl]]);

0 commit comments

Comments
 (0)