Sha256: 838d9a2d0dede60a20c971b76d3d8be5d662006339d419b4ae458ed171d5a63e

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

module Authpds
  module Controllers
    module AuthpdsSessionsController

    	# GET /user_sessions/new
    	# GET /login
    	def new
    		@user_session = UserSession.new(params)
    		redirect_to @user_session.login_url(params) unless @user_session.login_url.nil?
    		raise RuntimeError.new( "Error in #{self.class}.\nNo login url defined") if @user_session.login_url.nil?
    	end

    	# GET /validate
    	def validate
    		@user_session = UserSession.create(params[:user_session])
  	    redirect_to (params[:return_url].nil?) ? root_url : params[:return_url]
    	end

    	# DELETE /user_sessions/1
    	# GET /logout
    	def destroy
    		user_session = UserSession.find
    		logout_url = user_session.logout_url(params) unless user_session.nil?
    		user_session.destroy unless user_session.nil?
    		redirect_to user_session_redirect_url(logout_url)
    	end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authpds-0.1.2 lib/authpds/controllers/authpds_sessions_controller.rb
authpds-0.1.1 lib/authpds/controllers/authpds_sessions_controller.rb
authpds-0.1.0 lib/authpds/controllers/authpds_sessions_controller.rb
authpds-0.0.23 lib/authpds/controllers/authpds_sessions_controller.rb