Skip to content

Commit

Permalink
Cannot access login and register pages when authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
angelokezimana committed Jan 21, 2021
1 parent f42e5e1 commit 48727ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
namespace app\controllers;

use app\models\User;
use app\models\LoginForm;
use angelokezimana\elephpant\Request;
use angelokezimana\elephpant\Response;
use angelokezimana\elephpant\Controller;
use angelokezimana\elephpant\Application;
use app\models\LoginForm;
use angelokezimana\elephpant\middlewares\AuthMiddleware;
use angelokezimana\elephpant\middlewares\GuestMiddleware;

/**
* Class AuthController
Expand All @@ -21,6 +22,7 @@ class AuthController extends Controller
public function __construct()
{
$this->registerMiddleware(new AuthMiddleware(['profile']));
$this->registerMiddleware(new GuestMiddleware(['login', 'register'], '/profile'));
}

public function login(Request $request, Response $response)
Expand Down

0 comments on commit 48727ae

Please sign in to comment.