5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 05:21:42 +00:00

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] if @invitadx.confirmation_token = params[:confirmation_token]
@invitadx.update_attribute :confirmed, true @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
end end

View file

@ -7,13 +7,14 @@ class LoginController < ApplicationController
def new def new
@has_cover = true @has_cover = true
@site = Site.find(params[:site_id]) if params[:site_id].present?
render 'login/new' render 'login/new'
end end
def create def create
authenticate authenticate
session[:lang] = params[:lang] session[:lang] = params[:lang]
referer = request.referer unless /\/login\// =~ request.referer referer = request.referer unless /\/login/ =~ request.referer
if authenticated? if authenticated?
redirect_to referer || sites_path redirect_to referer || sites_path

View file

@ -23,6 +23,8 @@ en:
password: Password password: Password
password_confirmation: Repeat password password_confirmation: Repeat password
submit: Register submit: Register
confirmation:
confirmed: 'Your account is confirmed, please log in to continue'
info: info:
posts: posts:
reorder: "The articles have been reordered!" reorder: "The articles have been reordered!"

View file

@ -23,6 +23,8 @@ es:
password: Contraseña password: Contraseña
password_confirmation: Repite la contraseña password_confirmation: Repite la contraseña
submit: Registrarme submit: Registrarme
confirmation:
confirmed: 'Tu cuenta está confirmada, ahora puedes ingresar'
info: info:
posts: posts:
reorder: "¡Los artículos fueron reordenados!" reorder: "¡Los artículos fueron reordenados!"

View file

@ -18,6 +18,8 @@ Rails.application.routes.draw do
resources :invitadxs, only: [:index, :new] do resources :invitadxs, only: [:index, :new] do
get :confirmation, to: 'invitadxs#confirmation' get :confirmation, to: 'invitadxs#confirmation'
end end
get :'invitadxs/login/new', to: 'login#new'
post :'invitadxs/login', to: 'login#create'
get 'i18n', to: 'i18n#index' get 'i18n', to: 'i18n#index'
get 'i18n/edit', to: 'i18n#edit' get 'i18n/edit', to: 'i18n#edit'