25 lines
552 B
PHP
25 lines
552 B
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Modules\Auth\Services\AuthService;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
|
|
/**
|
|
* Login Page Controller
|
|
*
|
|
* GET /login shows form; form submits to /api/auth/login (client-side).
|
|
*/
|
|
class LoginController extends BaseController
|
|
{
|
|
public function index(): ResponseInterface
|
|
{
|
|
$authService = new AuthService();
|
|
if ($authService->currentUser() !== null) {
|
|
return redirect()->to('/dashboard');
|
|
}
|
|
|
|
return $this->response->setBody(view('login/index'));
|
|
}
|
|
}
|