From: Tom Hughes Date: Thu, 29 Oct 2020 21:25:47 +0000 (+0000) Subject: Allow redirects to authentication services from the settings page X-Git-Tag: live~1816 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/20ce10a9ef722cc95402ad2e488b56f32f8169e1 Allow redirects to authentication services from the settings page Chrome and Safari require redirects to match the form-action rule as well as the original submission address. --- diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cb92af8fb..288fb2d5c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -119,6 +119,10 @@ class UsersController < ApplicationController def account @tokens = current_user.oauth_tokens.authorized + append_content_security_policy_directives( + :form_action => %w[accounts.google.com *.facebook.com login.live.com github.com meta.wikimedia.org] + ) + if params[:user] && params[:user][:display_name] && params[:user][:description] if params[:user][:auth_provider].blank? || (params[:user][:auth_provider] == current_user.auth_provider &&