Sha256: 10ec5f6097de45343c75a40874a6480be206399301cd9864f855bc1cee229f08

Contents?: true

Size: 923 Bytes

Versions: 1

Compression:

Stored size: 923 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

1 entries across 1 versions & 1 rubygems

Version Path
authpds-0.2.0 lib/authpds/controllers/authpds_sessions_controller.rb