confirmar la cuenta e ingresar al sitio

This commit is contained in:
f 2018-09-28 12:00:50 -03:00
parent 39b575ebfb
commit bd3b2ce8c5
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
5 changed files with 12 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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!"

View file

@ -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!"

View file

@ -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'