Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in readme.md? #35

Open
salkz opened this issue Apr 14, 2018 · 1 comment
Open

Typo in readme.md? #35

salkz opened this issue Apr 14, 2018 · 1 comment

Comments

@salkz
Copy link

salkz commented Apr 14, 2018

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');
    }
}
@hernandev
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants