singleloginsystem/app/Http/Responses/LoginResponse.php
= 0921535ae2 Feat: Enhance OIDC nonce handling with middleware and session support
- Introduced `CaptureOidcNonce` middleware to capture and store nonce in session during GET requests.
- Updated `CustomAuthCodeRepository` to resolve nonce from session if not present in POST requests, ensuring seamless handling.
- Registered middleware in `bootstrap/app.php` for web routes.
- Adjusted `LoginResponse` to use `redirect()->intended` for improved redirection logic.
- Added comprehensive feature tests to validate nonce capture, session storage, and cache resolution workflows.
2026-06-17 09:17:06 +00:00

29 lines
662 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Responses;
use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;
/**
* This class is used overide the fortify LoginResponse class, so that
* we can redirect the user to the intended page after login.
*/
class LoginResponse implements LoginResponseContract
{
public function toResponse($request)
{
$user = $request->user();
activity()
->causedBy($user)
->withProperties([
'roles' => $user->getRoleNames(),
])
->log('User logged in}');
return redirect()->intended(route('dashboard'));
}
}