Sha256: 3e8fb84c6b47386c3f5442e349a197526e5c87ae63d5bf7b8874929bb9671e4b
Contents?: true
Size: 657 Bytes
Versions: 3
Compression:
Stored size: 657 Bytes
Contents
class SessionsController < ApplicationController before_filter :check_authentication, only: :destroy def new if authenticated? flash[:notice] = 'You are already logged in.' redirect_to landing_url end end def create user = User.authenticate params[:username], params[:password] if user signin user.username flash[:notice] = 'You have been logged in.' redirect_to landing_url else flash.now[:alert] = 'Your username and/or password are incorrect.' render :new end end def destroy signout flash[:notice] = 'You have been logged out.' redirect_to login_url end end
Version data entries
3 entries across 3 versions & 1 rubygems