Use http POST on rules acceptance button during registration (#39345)

This commit is contained in:
Matt Jankowski 2026-06-09 11:39:24 -04:00 committed by GitHub
parent 200fda1cdc
commit e0fc0858a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class Auth::AcceptancesController < ApplicationController
def create
redirect_to new_user_registration_path(registration_params)
end
private
def registration_params
params.permit(:accept, :invite_code).compact_blank
end
end

View File

@ -4,7 +4,7 @@
- content_for :header_tags do
= render partial: 'shared/og', locals: { description: description_for_sign_up(@invite) }
= form_with class: :simple_form, method: :get, url: new_user_registration_path do |form|
= form_with class: :simple_form, url: auth_acceptance_path do |form|
= render 'auth/shared/progress', stage: 'rules'
- if @invite.present? && @invite.autofollow?

View File

@ -74,6 +74,7 @@ Rails.application.routes.draw do
resource :unsubscribe, only: [:show, :create], controller: :unsubscriptions
namespace :auth do
resource :acceptance, only: [:create]
resource :setup, only: [:show, :update], controller: :setup
resource :challenge, only: [:create]
post 'captcha_confirmation', to: 'confirmations#confirm_captcha', as: :captcha_confirmation