diff --git a/app/controllers/invitadxs_controller.rb b/app/controllers/invitadxs_controller.rb index 3906c70d..3e2854f2 100644 --- a/app/controllers/invitadxs_controller.rb +++ b/app/controllers/invitadxs_controller.rb @@ -41,7 +41,10 @@ class InvitadxsController < ApplicationController if @invitadx.confirmation_token = params[:confirmation_token] @invitadx.update_attribute :confirmed, true - redirect_to site_ + flash[:info] = t('.confirmed') + redirect_to site_invitadxs_login_new_path(@site) + else + redirect_to root_path end end diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index 3ab0b558..e6ac36f5 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -7,13 +7,14 @@ class LoginController < ApplicationController def new @has_cover = true + @site = Site.find(params[:site_id]) if params[:site_id].present? render 'login/new' end def create authenticate session[:lang] = params[:lang] - referer = request.referer unless /\/login\// =~ request.referer + referer = request.referer unless /\/login/ =~ request.referer if authenticated? redirect_to referer || sites_path diff --git a/config/locales/en.yml b/config/locales/en.yml index 9bcfec0c..8be8106d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -23,6 +23,8 @@ en: password: Password password_confirmation: Repeat password submit: Register + confirmation: + confirmed: 'Your account is confirmed, please log in to continue' info: posts: reorder: "The articles have been reordered!" diff --git a/config/locales/es.yml b/config/locales/es.yml index aba594a2..f392465f 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -23,6 +23,8 @@ es: password: Contraseña password_confirmation: Repite la contraseña submit: Registrarme + confirmation: + confirmed: 'Tu cuenta está confirmada, ahora puedes ingresar' info: posts: reorder: "¡Los artículos fueron reordenados!" diff --git a/config/routes.rb b/config/routes.rb index af6d6e64..3c9b784f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,6 +18,8 @@ Rails.application.routes.draw do resources :invitadxs, only: [:index, :new] do get :confirmation, to: 'invitadxs#confirmation' end + get :'invitadxs/login/new', to: 'login#new' + post :'invitadxs/login', to: 'login#create' get 'i18n', to: 'i18n#index' get 'i18n/edit', to: 'i18n#edit'