CluPilotCloud/app/Http/Responses/ConsoleAwareTwoFactorLoginR...

26 lines
761 B
PHP

<?php
namespace App\Http\Responses;
use Illuminate\Http\JsonResponse;
use Laravel\Fortify\Contracts\TwoFactorLoginResponse;
use Symfony\Component\HttpFoundation\Response;
/**
* Where a sign-in completed by two-factor challenge lands.
*
* Fortify never reaches LoginResponse on this path, so binding only that one
* left every account with two-factor enabled — which is the ones most likely to
* be operators — landing in the customer portal.
*/
class ConsoleAwareTwoFactorLoginResponse implements TwoFactorLoginResponse
{
use LandsWhereSignedIn;
public function toResponse($request): Response
{
// Fortify answers an empty 204 here, not a body. Kept.
return $this->landing($request, new JsonResponse('', 204));
}
}