Sha256: 2eb41d5b09868896bfd4556906d3267993820ce79f52459357670b81b5ebccb4

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

module Authorizme
  class AuthorizmeController < ::ApplicationController
    respond_to :html, :json, :xml
    layout "authorizme/layouts/popup"

    def index
      @user = current_user
    end

    protected
      
      def logout
      	session[:user_id] = nil
        if Authorizme::remote
          respond_with_status "logged_out"
        else
          redirect_to Authorizme::after_logout_path
        end
      end
      
      def render_popup_view
        render "popup", :layout => "authorizme/layouts/popup"
      end
      
      def respond_with_status status_name, attributes = nil
        status = {status: status_name}
        status = status.merge(attributes) if attributes
        respond_with status
      end
      
      def redirect_uri provider
        if Rails.env.development?
          "http://#{request.host}:#{request.port}/#{Authorizme::namespace}/login/#{provider}/callback"
        else
          "http://#{request.host}/#{Authorizme::namespace}/login/#{provider}/callback"
        end
      end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authorizme-0.0.5 app/controllers/authorizme/authorizme_controller.rb
authorizme-0.0.4 app/controllers/authorizme/authorizme_controller.rb