mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
c4b4411513
Throughout the documentations, we are using 'encrypt' incorrectly. Encrypt means that someone will eventually decrypt the message, which is obviously not the case for Devise. I'm changing the docs to use 'hashing' instead. However, I left the database field as `encrypted_password` for now. I'll update the db field in an upcoming PR.
33 lines
833 B
Ruby
33 lines
833 B
Ruby
class Configurable < User
|
|
devise :database_authenticatable, :confirmable, :rememberable, :timeoutable, :lockable,
|
|
stretches: 15, pepper: 'abcdef', allow_unconfirmed_access_for: 5.days,
|
|
remember_for: 7.days, timeout_in: 15.minutes, unlock_in: 10.days
|
|
end
|
|
|
|
class WithValidation < Admin
|
|
devise :database_authenticatable, :validatable, password_length: 2..6
|
|
end
|
|
|
|
class UserWithValidation < User
|
|
validates_presence_of :username
|
|
end
|
|
|
|
class UserWithCustomHashing < User
|
|
protected
|
|
def password_digest(password)
|
|
password.reverse
|
|
end
|
|
end
|
|
|
|
class UserWithVirtualAttributes < User
|
|
devise case_insensitive_keys: [:email, :email_confirmation]
|
|
validates :email, presence: true, confirmation: { on: :create }
|
|
end
|
|
|
|
class Several < Admin
|
|
devise :validatable
|
|
devise :lockable
|
|
end
|
|
|
|
class Inheritable < Admin
|
|
end
|