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
Post a Comment