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.10.1 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.10.0 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.9.0 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.8.3 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.8.2 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.7.3 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.6.6 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.5.5 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.0.9 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.1.15 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.2.7 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.3.3 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.4.1 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.5.4 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.6.5 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.7.2 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.7.1 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.6.4 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.7.0 app/models/concerns/spree/user_api_authentication.rb
spree_api-4.6.3 app/models/concerns/spree/user_api_authentication.rb