class UserSessionsController < ApplicationController skip_before_action :require_user respond_to :html def new @user_session = SpudUserSession.new end def create @user_session = SpudUserSession.new(params[:spud_user_session]) if @user_session.save flash[:notice] = "Login successful!" redirect_back_or_default('/') else render 'new' end end def destroy current_user_session.destroy unless current_user_session.blank? flash[:notice] = "Logout successful!" redirect_to login_path end end