Open
Description
Token from User Credentials.
This method should be used when you just registered a user and any other special cases.
I think this should be "This method should be used when you want to authenticate a user and any other special cases." because the function
public function tokenFromCredentials(Guard $auth, Request $request)
{
// get some credentials
$credentials = $request->only(['email', 'password']);
if ($auth->attempt($credentials)) {
return $token = $auth->issue();
}
return ['Invalid Credentials'];
}
really looks like the one in https://laravel.com/docs/5.6/authentication#authenticating-users section.
public function authenticate(Request $request)
{
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
// Authentication passed...
return redirect()->intended('dashboard');
}
}
Metadata
Metadata
Assignees
Labels
No labels