Update authenticate method

Replaces #4229
This commit is contained in:
Vincent Klaiber 2018-04-09 14:22:51 +02:00 committed by GitHub
parent 7aebdfcf7f
commit 5b42917a67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -218,7 +218,8 @@ We will access Laravel's authentication services via the `Auth` [facade](/docs/{
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class LoginController extends Controller
@ -226,11 +227,15 @@ We will access Laravel's authentication services via the `Auth` [facade](/docs/{
/**
* Handle an authentication attempt.
*
* @param \Illuminate\Http\Request $request
*
* @return Response
*/
public function authenticate()
public function authenticate(Request $request)
{
if (Auth::attempt(['email' => $email, 'password' => $password])) {
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
// Authentication passed...
return redirect()->intended('dashboard');
}