ruby on rails - devise :password and :encrypted_password -


in devise rails gem, difference between these two?

i have seen :encrypted_password field in generated schema not :password field.

any explanations if these 2 interconnected each other?

devise::models::databaseauthenticatable has setter that:

def password=(new_password)   @password = new_password   self.encrypted_password = password_digest(@password) if @password.present? end 

so should set password if there password field, devise take care of encrypting it.

as @spickermann pointed out - plain text password should never stored anywhere , should filtered out logs/error messages , on, because produces huge security risk: encrypted password leak not totally harmless, not dangerous much.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -