]> git.openstreetmap.org Git - rails.git/commitdiff
Use a 307 Temporary Redirect to redirect to authentication
authorTom Hughes <tom@compton.nu>
Wed, 3 Mar 2021 09:27:33 +0000 (09:27 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 3 Mar 2021 09:27:33 +0000 (09:27 +0000)
When the user wants to enable an external authenticator we need
to redirect to omniauth but that now needs to be a POST so use a
redirect that preserves the POST method.

Fixes #3114

app/controllers/users_controller.rb

index aa504e3131a23380572d4f4d70d8e20aa9e59f3a..121d050b58bec7392f31bfd6771ae83ffbd9620d 100644 (file)
@@ -131,7 +131,7 @@ class UsersController < ApplicationController
         redirect_to user_account_url(current_user) if current_user.errors.count.zero?
       else
         session[:new_user_settings] = params
         redirect_to user_account_url(current_user) if current_user.errors.count.zero?
       else
         session[:new_user_settings] = params
-        redirect_to auth_url(params[:user][:auth_provider], params[:user][:auth_uid])
+        redirect_to auth_url(params[:user][:auth_provider], params[:user][:auth_uid]), :status => :temporary_redirect
       end
     elsif errors = session.delete(:user_errors)
       errors.each do |attribute, error|
       end
     elsif errors = session.delete(:user_errors)
       errors.each do |attribute, error|