Sha256: 11e5606064a59b9f975bd087e52cd8a7aa11a98d8c0f742313971ce8869f2b6f
Contents?: true
Size: 422 Bytes
Versions: 20
Compression:
Stored size: 422 Bytes
Contents
class SessionsController < ApplicationController def new end def create user = User.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) sign_in user redirect_back_or user else flash.now[:error] = 'Invalid email/password combination' render 'new' end end def destroy sign_out redirect_to root_url end end
Version data entries
20 entries across 20 versions & 2 rubygems