devsofttech_hms_ci4/app/Controllers/AuthSession.php
DevSoftTech Server c263b9e4ac feat: add role and session access controls
Add configurable role management, expanded project permission coverage, secured module routes, and single-active-session enforcement with online user administration.
2026-08-09 23:21:16 +05:30

21 lines
496 B
PHP

<?php
namespace App\Controllers;
class AuthSession extends BaseController
{
public function status()
{
if (! function_exists('auth') || ! auth()->loggedIn()) {
return $this->response->setStatusCode(401)->setJSON([
'active' => false,
'login_url' => base_url('login'),
]);
}
return $this->response->setJSON([
'active' => true,
'checked_at' => date('Y-m-d H:i:s'),
]);
}
}