Sha256: a87dc7558fb2a1b8e9c9f1fc5e23e5efeb955fff73702f92d3a26413c938aacd

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 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
      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.7 app/controllers/authorizme/authorizme_controller.rb
authorizme-0.0.6 app/controllers/authorizme/authorizme_controller.rb