Sha256: f8278199af932b4789de83e6bba293233eeb3afd80898229ef0c26ac691e702e

Contents?: true

Size: 672 Bytes

Versions: 4

Compression:

Stored size: 672 Bytes

Contents

class UserSessionsController < ApplicationController
  before_filter :prevent_store_location, :only => [:destroy, :create]
  before_filter :require_no_user, :only => [:new, :create]
  before_filter :require_user, :only => :destroy
  
  def new
    @user_session = UserSession.new
  end
  
  def create
    @user_session = UserSession.new(params[:user_session])
    if @user_session.save
      flash[:notice] = "Login successful!"
      redirect_back_or_default(account_url)
    else
      render :action => :new
    end
  end
  
  def destroy
    @user_session.destroy
    flash[:notice] = "Logout successful!"
    redirect_back_or_default(new_user_session_url)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authgasm-0.10.2 test_app/app/controllers/user_sessions_controller.rb
authgasm-0.10.0 test_app/app/controllers/user_sessions_controller.rb
authgasm-0.10.1 test_app/app/controllers/user_sessions_controller.rb
authgasm-0.10.3 test_app/app/controllers/user_sessions_controller.rb