app/Http/Controllers/Auth/MagicLoginController.php
/**
     * Handle a login request to the application.
     *
     * @param \Illuminate\Http\Request $request
     * @param \App\Models\User         $user
     *
     * @return \Illuminate\Http\RedirectResponse
     */
Handle a login request to the application.


Handle a login request to the application .
public function login(Request $request, User $user): RedirectResponse
    {
        abort_unless($request->hasValidSignature(), 401);
        if ($user->uses_two_factor_auth) {
            Auth::logout();
            $request->session()->put(['app:auth:id' => $user->id]);
            return redirect('login/token');
        }
        Auth::login($user);
        return redirect($this->redirectPath());
    }
public function login ( Request $ request , User $ user ) : RedirectResponse { abort_unless ( $ request -> hasValidSignature ( ) , 401 ) ; if ( $ user -> uses_two_factor_auth ) { Auth :: logout ( ) ; $ request -> session ( ) -> put ( [ 'app:auth:id' => $ user -> id ] ) ; return redirect ( 'login/token' ) ; } Auth :: login ( $ user ) ; return redirect ( $ this -> redirectPath ( ) ) ; }
Handle a login request to the application.
Handle a login request to the application .