Module: Magnews::HeaderHelper

Included in:
Contact
Defined in:
lib/magnews/util/header_helper.rb

Instance Method Summary collapse

Instance Method Details

#auth_headerObject



3
4
5
6
# File 'lib/magnews/util/header_helper.rb', line 3

def auth_header
  raise Magnews::MissingAuthToken if Magnews.auth_token.blank?
  { Authorization: "Bearer #{Magnews.auth_token}" }
end

#common_headersObject



8
9
10
# File 'lib/magnews/util/header_helper.rb', line 8

def common_headers
  auth_header.merge({ content_type: :json, accept: :json })
end