From: Tom Hughes Date: Wed, 3 Mar 2021 09:27:33 +0000 (+0000) Subject: Use a 307 Temporary Redirect to redirect to authentication X-Git-Tag: live~1794 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/2233edbcfa15d532c2232e5e71a2a2495e3a72eb?hp=ff3a30d2458cc11ce058343fc6e55b894dc33d9c Use a 307 Temporary Redirect to redirect to authentication 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 --- diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index aa504e313..121d050b5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 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|