Class: OmniAuth::Strategies::Sandstorm

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/sandstorm.rb

Instance Method Summary collapse

Instance Method Details

#request_phaseObject



25
26
27
# File 'lib/omniauth/strategies/sandstorm.rb', line 25

def request_phase
  redirect callback_path
end

#sandstorm_header(field) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/omniauth/strategies/sandstorm.rb', line 29

def sandstorm_header(field)
  raw_header = request.env["HTTP_X_SANDSTORM_#{field.to_s.upcase}"]
  if field == :username
    URI.unescape(raw_header).force_encoding(Encoding::UTF_8)
  else
    raw_header.nil? ? nil : raw_header.encode(Encoding::UTF_8)
  end
end