Class: Cabal::API::User

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/cabal/api/user.rb

Instance Method Summary collapse

Instance Method Details

#authenticated_with?(secret_key) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'lib/cabal/api/user.rb', line 21

def authenticated_with?(secret_key)
  return false unless crypted_secret_key.length > 0

  BCrypt::Password.new(crypted_secret_key) == secret_key
end

#crypto_keyObject



17
18
19
# File 'lib/cabal/api/user.rb', line 17

def crypto_key
  "#{email}::#{created_at}::#{access_key}"
end