laravel-jwt
laravel-jwt copied to clipboard
Typo in readme.md?
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');
}
}
Correct.
if you notice, the two sections have the same explanation, meaning I've just copied it over and forgot to change.
Lazy me.
Wanna PR a fix? If not, I'll update that later today.
Thanks for the feedback, I don't have the habit of reading after, should do it more often.
Thank you!