class Registrar::Middleware::ConvertOmniAuthHashToRegistrarHash

Public Class Methods

new(app, time = Time) click to toggle source
# File lib/registrar/middleware/convert_omniauth_hash_to_registrar_hash.rb, line 4
def initialize(app, time = Time)
  @app = app
  @time = time
end

Public Instance Methods

call(env) click to toggle source
# File lib/registrar/middleware/convert_omniauth_hash_to_registrar_hash.rb, line 9
def call(env)
  try_to_normalize_auth(env)
  @app.call(env)
end

Private Instance Methods

try_to_normalize_auth(env) click to toggle source
# File lib/registrar/middleware/convert_omniauth_hash_to_registrar_hash.rb, line 16
def try_to_normalize_auth(env)
  if env['omniauth.auth']
    env['registrar.auth'] = RegistrarHash.build(env, @time)
  end
end