1

My getCredentials() method is using login, password and client_id

I moved it into my authController, modified and it works like a charm with one exception. When login fails my login form is only populated with previously used login (password is obviously empty) but client_id is missing.

I KNOW i can add it in postLogin() but I'd like to keep "vendor" part untouched.

What is the best practice here? Should I move also the whole postLogin() to my authController as well and change it there?

2
  • I have left, answer try see if it helps and let me know Commented Apr 2, 2016 at 17:36
  • Use old('client_id', $clientId) as the default value for the form field. Commented Apr 2, 2016 at 19:21

1 Answer 1

1

One way to go is to use $remember.

Regarding to Laravel documentation, you need to add $remember like:

if (Auth::attempt(['email' => $email, 'password' => $password], $remember))
{
    // The user is being remembered...
}

And in your blade add a check box like

<div>
    <input id="RememberMe" name="rememberme" type="checkbox"/>
    <label for="RememberMe">Remember Me</label>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.