0

I have a non-standard login requirement.

Let's just assume that for the same user there are 2 password columns in the db. Laravel needs to check the first password, if failed, then verify the password against the second password in the DB. If both passwords do not match then return false in the login check. However, the app needs to set a mode depending on which password was being used.

If password A was matched, then mode can be A or either true. If password B was matched, then mode can be B or either false. Or something along these lines.

I have used the out of the box authentication of Laravel. Can someone please point me on the right direction on how to do the additional check if the 1st password failed and where to add the additional codings on setting the "mode".

Thank you very much in Advance

1 Answer 1

1

You need to override the login() function in the app/Http/Controllers/Auth/LoginController.php

The original definition of the function is in the trait the LoginController use: Illuminate\Foundation\Auth\AuthenticatesUsers you can start from there and make your modifications.

If you want to keep trace of what kind of password a User used on login I will set a Session variable at the login() function.

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.