Class: Spree::LegacyAdminUser

Inherits:
Object
  • Object
show all
Includes:
AdminUserMethods
Defined in:
app/models/spree/legacy_admin_user.rb

Constant Summary

Constants included from PrefixedId

PrefixedId::SQIDS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AdminUserMethods

#can_be_deleted?, #full_name

Methods included from PrefixedId

#prefixed_id, #to_param

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



11
12
13
# File 'app/models/spree/legacy_admin_user.rb', line 11

def password
  @password
end

#password_confirmationObject

Returns the value of attribute password_confirmation.



11
12
13
# File 'app/models/spree/legacy_admin_user.rb', line 11

def password_confirmation
  @password_confirmation
end

Instance Method Details

#valid_password?(check_password) ⇒ Boolean

Simple password validation for testing purposes In production, Spree.admin_user_class should be overridden with a proper auth solution (e.g., Devise)

Returns:

  • (Boolean)


19
20
21
22
23
# File 'app/models/spree/legacy_admin_user.rb', line 19

def valid_password?(check_password)
  return false if encrypted_password.blank?

  BCrypt::Password.new(encrypted_password) == check_password
end