I program the timeclock system, where the user effectively hits his timelock by entering their username and password on a specific computer. The timeclock user will log in first. I just need to register what the user has discovered by checking that they have entered username and password correctly. How to do it in Devise ?
username
password
Devise
I do not want them to register in , just make sure that they are who they call themselves. The timeclock user is always a registered user.
If you are using gem devise. Try
User.find(1).valid_password?('password123') # returns true/false
This code in the file: devise / lib / devise / models / database_authenticatable.rb
Devise gives you two built-in methods that let you do just that:
user = User.find_for_authentication(username: params[:username]) user.valid_password?(params[:password])