Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2022-10-30 19:35:59 +01:00
commit 96bd245f04
2 changed files with 3 additions and 1 deletions

View file

@ -153,6 +153,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
return if @rules.empty? || (session[:accept_token].present? && params[:accept] == session[:accept_token])
@accept_token = session[:accept_token] = SecureRandom.hex
@invite_code = invite_code
set_locale { render :rules }
end

View file

@ -14,7 +14,8 @@
.rules-list__text= rule.text
.stacked-actions
= link_to t('auth.rules.accept'), new_user_registration_path(accept: @accept_token), class: 'button'
- accept_path = @invite_code.present? ? public_invite_url(invite_code: @invite_code, accept: @accept_token) : new_user_registration_path(accept: @accept_token)
= link_to t('auth.rules.accept'), accept_path, class: 'button'
= link_to t('auth.rules.back'), root_path, class: 'button button-tertiary'
.form-footer= render 'auth/shared/links'