Sha256: e6c1b8ad32b2aa588f527a5da4deb24fa9333a1a09b59259b5e20a07edd86b7c

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

module Authorizme
  class AuthorizmeController < ::ApplicationController
    respond_to :html, :json, :xml
    layout "authorizme/layouts/popup"
    before_filter :check_synchronize, :only => [:auth]

    def index
      @user = current_user
    end

    protected

      def check_synchronize
        if params[:synchronize]
          session[:synchronize] = true
        end
      end
      
      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, :location => nil
      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

5 entries across 5 versions & 1 rubygems

Version Path
authorizme-1.0.0 app/controllers/authorizme/authorizme_controller.rb
authorizme-0.0.11 app/controllers/authorizme/authorizme_controller.rb
authorizme-0.0.10 app/controllers/authorizme/authorizme_controller.rb
authorizme-0.0.9 app/controllers/authorizme/authorizme_controller.rb
authorizme-0.0.8 app/controllers/authorizme/authorizme_controller.rb