Saturday, March 18, 2017

Comparing 2 Passwords on login with Laravel

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



via Ela Buwa

Advertisement