Sha256: e6927d840dd8bf3e040a24a290cca034c136a807c320d28f8a3c74157b7562a1

Contents?: true

Size: 593 Bytes

Versions: 4

Compression:

Stored size: 593 Bytes

Contents

module Foyer
  class OmniauthCallbacksController < ActionController::Base
    include Controller::Helpers

    def passthru
      head :not_found
    end

    def failure
      fail NotImplementedError
    end

    def callback
      fail NotImplementedError
    end

    protected

    def after_sign_in_path
      return origin if origin.to_s.match(%r{^\/}) || origin.to_s.match(%r{^#{request.scheme}://#{request.host}})
      root_path
    end

    private

    def origin
      request.env['omniauth.origin']
    end

    def auth_hash
      request.env['omniauth.auth']
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foyer-0.5.0 lib/foyer/omniauth_callbacks_controller.rb
foyer-0.4.0 lib/foyer/omniauth_callbacks_controller.rb
foyer-0.3.1 lib/foyer/omniauth_callbacks_controller.rb
foyer-0.2.2 lib/foyer/omniauth_callbacks_controller.rb