mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-01 18:47:29 +00:00
98 - Testing the Login Endpoint
This commit is contained in:
@@ -3,37 +3,19 @@
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
public function login()
|
||||
{
|
||||
$this->middleware('guest', ['except' => 'logout']);
|
||||
if (! Auth::attempt(request(['email', 'password']))) {
|
||||
return redirect('/login')->withErrors([
|
||||
'email' => ['These credentials do not match our records.'],
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect('/backstage/concerts');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user