Sha256: 13aad6ae3099fe299398f395262ae1b05cff7153e003ee399867c3a3e53b6df3
Contents?: true
Size: 730 Bytes
Versions: 8
Compression:
Stored size: 730 Bytes
Contents
class SessionController < BaseController renders_with_error_proc :below_field skip_before_action :verify_authenticity_token # disable forgery protection layout 'login' def new @user = User.new end def create if authenticate_user(params[:user]) remember_me! if params[:user][:remember_me] redirect_to return_from(:login), notice: "Logged in successfully." else @user = User.new(:email => params[:user][:email]) @remember_me = params[:user][:remember_me] flash.now.alert = "Could not login with this email and password." render :action => 'new' end end def destroy logout redirect_to return_from(:logout), notice: "Logged out successfully." end end
Version data entries
8 entries across 8 versions & 1 rubygems