Sha256: 728b1c04b5080f23e0b86f96970098f69614d01a74c9708e1b40ad4328449f9b

Contents?: true

Size: 1022 Bytes

Versions: 2

Compression:

Stored size: 1022 Bytes

Contents

require 'openssl'

module MnoEnterprise::Concerns::Models::IntercomUser
  extend ActiveSupport::Concern

  #==================================================================
  # Included methods
  #==================================================================
  # 'included do' causes the included code to be evaluated in the
  # context where it is included rather than being executed in the module's context
  included do
  end

  #==================================================================
  # Class methods
  #==================================================================
  module ClassMethods
  end

  #==================================================================
  # Instance methods
  #==================================================================
  # Return intercom user hash
  # This is used in secure mode
  def intercom_user_hash
    OpenSSL::HMAC.hexdigest('sha256', MnoEnterprise.intercom_api_secret, (self.id || self.email).to_s) if MnoEnterprise.intercom_api_secret
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mno-enterprise-core-3.2.1 lib/mno_enterprise/concerns/models/intercom_user.rb
mno-enterprise-core-3.2.0 lib/mno_enterprise/concerns/models/intercom_user.rb