Sha256: e655d13a03b32cf81fdcc3af5840b21c55121ff27bf881803724030a23b03259
Contents?: true
Size: 660 Bytes
Versions: 5
Compression:
Stored size: 660 Bytes
Contents
class SessionsController < ApplicationController def new end def create user = User.find_by_email(params[:email]) if user && user.authenticate(params[:password]) if params[:remember_me] cookies.permanent[:auth_token] = user.auth_token else cookies[:auth_token] = user.auth_token end redirect_to root_url, notice: t('authentication.login_confirmation') else flash.now.alert = t('authentication.warning.email_or_password_invalid') render "new" end end def destroy cookies.delete(:auth_token) redirect_to root_url, notice: t('authentication.logout_confirmation') end end
Version data entries
5 entries across 5 versions & 1 rubygems