remove codeigniter
This commit is contained in:
@@ -13,7 +13,7 @@ use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* CodeIgniter `AuthController` web (session) flow: session keys, dashboards, redirects, preferences.
|
||||
* Session-auth flow: session keys, dashboards, redirects, and preferences.
|
||||
*/
|
||||
class AuthSessionService
|
||||
{
|
||||
@@ -25,7 +25,7 @@ class AuthSessionService
|
||||
}
|
||||
|
||||
/**
|
||||
* Same-host relative redirect sanitization as CI `sanitizeRedirectTarget`.
|
||||
* Sanitizes login redirects to same-host relative paths only.
|
||||
*/
|
||||
public function sanitizeRedirectTarget(string $redirectTo): ?string
|
||||
{
|
||||
@@ -84,7 +84,7 @@ class AuthSessionService
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply CI-style preference keys into session (style/menu colors).
|
||||
* Apply stored style preferences into the session.
|
||||
*/
|
||||
public function applyStylePreferencesToSession(int $userId): void
|
||||
{
|
||||
@@ -114,11 +114,11 @@ class AuthSessionService
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate Laravel web auth + CI-compatible session keys.
|
||||
* Populate Laravel web auth and session state for the web portal.
|
||||
*
|
||||
* @param list<string> $roleNames
|
||||
*/
|
||||
public function writeCiAuthenticatedSession(User $user, array $roleNames): void
|
||||
public function writeAuthenticatedSession(User $user, array $roleNames): void
|
||||
{
|
||||
Auth::guard('web')->login($user);
|
||||
|
||||
@@ -145,7 +145,7 @@ class AuthSessionService
|
||||
}
|
||||
|
||||
/**
|
||||
* Close open login_activity row(s) without logout_time for this user (CI parity).
|
||||
* Close open login_activity rows without logout_time for this user.
|
||||
*/
|
||||
public function logLogout(?int $userId, ?string $email): void
|
||||
{
|
||||
@@ -169,7 +169,7 @@ class AuthSessionService
|
||||
*/
|
||||
public function resolvePostLoginDestination(User $user, ?string $sanitizedRedirect): array
|
||||
{
|
||||
$roleNames = $user->roleNamesLikeCodeIgniter();
|
||||
$roleNames = $user->roleNames();
|
||||
|
||||
if ($roleNames === []) {
|
||||
Log::notice('session_login: user has no roles', ['user_id' => $user->id]);
|
||||
@@ -180,7 +180,7 @@ class AuthSessionService
|
||||
];
|
||||
}
|
||||
|
||||
$this->writeCiAuthenticatedSession($user, $roleNames);
|
||||
$this->writeAuthenticatedSession($user, $roleNames);
|
||||
|
||||
if (count($roleNames) === 1) {
|
||||
session()->put('role', $roleNames[0]);
|
||||
|
||||
Reference in New Issue
Block a user