Skip to content

Commit

Permalink
Удалены ссылки на роут home
Browse files Browse the repository at this point in the history
  • Loading branch information
visavi committed May 15, 2023
1 parent 1aa3924 commit 116c2aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/Controllers/User/UserController.php
Expand Up @@ -57,7 +57,7 @@ public function index(Request $request, Response $response): Response
public function login(Request $request, Response $response): Response
{
if (isUser()) {
return $this->redirect($response, route('home'));
return $this->redirect($response, '/');
}

if ($request->getMethod() === 'POST') {
Expand Down Expand Up @@ -117,7 +117,7 @@ public function register(Request $request, Response $response): Response
}

if (isUser()) {
return $this->redirect($response, route('home'));
return $this->redirect($response, '/');
}

if ($request->getMethod() === 'POST') {
Expand Down Expand Up @@ -275,7 +275,7 @@ public function confirm(string $code, Response $response): Response
}

if ($user && $user->role !== User::PENDED) {
return $this->redirect($response, route('home'));
return $this->redirect($response, '/');
}

if ($user && $user->confirm_code === $code) {
Expand All @@ -289,6 +289,6 @@ public function confirm(string $code, Response $response): Response
$this->session->set('flash', ['danger' => 'Проверочный код неверный!']);
}

return $this->redirect($response, route('home'));
return $this->redirect($response, '/');
}
}
2 changes: 1 addition & 1 deletion app/Middleware/CheckAccessMiddleware.php
Expand Up @@ -18,7 +18,7 @@ public function process(
$user = getUser();
$response = $handler->handle($request);

if ($user && ! in_array(currentRoute(), [route('home'), route('logout')], true)) {
if ($user && ! in_array(currentRoute(), ['/', '/logout'], true)) {
if ($user->isBanned()) {
abort(403, 'Вы забанены!');
}
Expand Down

0 comments on commit 116c2aa

Please sign in to comment.