Sha256: 3c363d97645b13e4306ac29cf0fe1d4e5b57bea0d15d24ef22a5a35023a94787
Contents?: true
Size: 1.18 KB
Versions: 12
Compression:
Stored size: 1.18 KB
Contents
module Authpds module Controllers module AuthpdsUserSessionsController # GET /user_sessions/new # GET /login def new @user_session = UserSession.new(params) @user_session.before_login(params) and return if performed? 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.new(params[:user_session]) @user_session.save do |result| @user_session.errors.each_full {|error| flash[:error] = "There was an error logging in. #{error}" logger.error("Error in #{self.class} while saving user session. #{error}") } unless result redirect_to (params[:return_url].nil?) ? root_url : params[:return_url] end end # DELETE /user_sessions/1 # GET /logout def destroy user_session = UserSession.find logout_url = user_session.logout_url(params) user_session.destroy unless user_session.nil? redirect_to user_session_redirect_url(logout_url) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems