Module: Spree::UserApiAuthentication

Included in:
UserMethods
Defined in:
app/models/concerns/spree/user_api_authentication.rb

Instance Method Summary collapse

Instance Method Details

#clear_spree_api_keyObject



19
20
21
# File 'app/models/concerns/spree/user_api_authentication.rb', line 19

def clear_spree_api_key
  self.spree_api_key = nil
end

#clear_spree_api_key!Object



14
15
16
17
# File 'app/models/concerns/spree/user_api_authentication.rb', line 14

def clear_spree_api_key!
  clear_spree_api_key
  save!
end

#generate_spree_api_keyObject



10
11
12
# File 'app/models/concerns/spree/user_api_authentication.rb', line 10

def generate_spree_api_key
  self.spree_api_key = SecureRandom.hex(24)
end

#generate_spree_api_key!Object



5
6
7
8
# File 'app/models/concerns/spree/user_api_authentication.rb', line 5

def generate_spree_api_key!
  generate_spree_api_key
  save!
end