Right now we have phone_number as login, and sms code (4 digits) as password. When user wants to login:
- user enters phone number
- we generate code
- we save code to user password field
- we send code to user via sms
- user uses this sms code to login in
We want to be able to have last 3 generated codes (password) be valid for login:
- we started to save generated codes in separate table
And here is the question: How do I connect this to authlogic? Is the any callback that turns off default password check and give me ability to add my custom logic for password checking?
I found a solution which helped me to tune password validation logic. My
authlogicversion 3.5.6 and I has method calledvalidate_by_passwordin following implementation. I copied first part of it to save blank fields and logic checks. And overwrote invalid password check in way I need.