no redireccion a login al loguearse directamente

This commit is contained in:
f 2018-09-22 11:49:52 -03:00
parent 81564985c5
commit 79b24b72da
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -13,9 +13,10 @@ class LoginController < ApplicationController
def create def create
authenticate authenticate
session[:lang] = params[:lang] session[:lang] = params[:lang]
referer = request.referer unless /\/login\// =~ request.referer
if authenticated? if authenticated?
redirect_to request.referer || sites_path redirect_to referer || sites_path
else else
flash[:danger] = t('login.error') flash[:danger] = t('login.error')
render 'login/new' render 'login/new'