mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 10:42:16 +01:00
28 lines
676 B
PHP
28 lines
676 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Extensions\Fortify;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Inertia;
|
|
use Laravel\Fortify\Http\Responses\LoginResponse;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class CustomLoginResponse extends LoginResponse
|
|
{
|
|
/**
|
|
* Create an HTTP response that represents the object.
|
|
*
|
|
* @param Request $request
|
|
*/
|
|
public function toResponse($request): Response
|
|
{
|
|
$redirectPath = session()->pull('url.intended', route('dashboard', [], false));
|
|
|
|
return $request->wantsJson()
|
|
? response()->json(['two_factor' => false])
|
|
: Inertia::location($redirectPath);
|
|
}
|
|
}
|