Sha256: 5417162e797e20c1d4e2d1a51d0f3d6ed13c36c2f6ffb7668f19a4fe705791b9

Contents?: true

Size: 317 Bytes

Versions: 168

Compression:

Stored size: 317 Bytes

Contents

module Spree
  module UserApiAuthentication
    def generate_spree_api_key!
      self.spree_api_key = generate_spree_api_key
      save!
    end

    def clear_spree_api_key!
      self.spree_api_key = nil
      save!
    end

    private

    def generate_spree_api_key
      SecureRandom.hex(24)
    end
  end
end

Version data entries

168 entries across 168 versions & 4 rubygems

Version Path
spree_api-4.1.0.rc3 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.1.0.rc2 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.1.0.rc1 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.4.6 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.10 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.3 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.9 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.2 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.8 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.1 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.7 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.0 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.0.rc3 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.6 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.5 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.0.rc2 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.0.rc1 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.0.beta app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.4 app/models/concerns/spree/user_api_authentication.rb
spree_api-3.7.3 app/models/concerns/spree/user_api_authentication.rb