From 363a80b085703541bcf783dbf03b6a634a3670f9 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 11 Feb 2019 16:40:12 -0300 Subject: [PATCH] enviar a lxs invitadxs a la raiz del sitio --- app/controllers/login_controller.rb | 2 ++ app/views/login/new.haml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index e6ac36f5..6bae992c 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -8,6 +8,7 @@ class LoginController < ApplicationController def new @has_cover = true @site = Site.find(params[:site_id]) if params[:site_id].present? + render 'login/new' end @@ -15,6 +16,7 @@ class LoginController < ApplicationController authenticate session[:lang] = params[:lang] referer = request.referer unless /\/login/ =~ request.referer + referer = params[:referer] if params[:referer].present? if authenticated? redirect_to referer || sites_path diff --git a/app/views/login/new.haml b/app/views/login/new.haml index 33f206ec..504cc613 100644 --- a/app/views/login/new.haml +++ b/app/views/login/new.haml @@ -3,6 +3,8 @@ = render 'layouts/flash' = form_tag login_path do + - if @site + %input{type: 'hidden', name: 'referer', value: site_path(@site)} .form-group %input{type: 'email', name: 'username', class: 'form-control', placeholder: t('login.email')} .form-group