init backend presensi
This commit is contained in:
24
app/Controllers/LoginController.php
Normal file
24
app/Controllers/LoginController.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user