Skip to content

Commit

Permalink
Fix invites (mastodon#19560)
Browse files Browse the repository at this point in the history
Fixes mastodon#19507

Fix regression from mastodon#19296
  • Loading branch information
ClearlyClaire authored Oct 30, 2022
1 parent ac9fb0d commit a529d6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/auth/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def require_rules_acceptance!
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
Expand Down
3 changes: 2 additions & 1 deletion app/views/auth/registrations/rules.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit a529d6d

Please sign in to comment.