]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Add warnings when creating notes anonymously
[rails.git] / app / controllers / users_controller.rb
index c3c4dcfb3e81b260c9a65b5193c174f541f35fc8..2cdec642d33ed8a4876defd7f53100b97b1d18f6 100644 (file)
@@ -63,7 +63,7 @@ class UsersController < ApplicationController
     parse_oauth_referer @referer
 
     append_content_security_policy_directives(
-      :form_action => %w[accounts.google.com *.facebook.com login.live.com github.com meta.wikimedia.org]
+      :form_action => %w[accounts.google.com *.facebook.com login.microsoftonline.com github.com meta.wikimedia.org]
     )
 
     if current_user
@@ -78,10 +78,11 @@ class UsersController < ApplicationController
                                    :auth_provider => params[:auth_provider],
                                    :auth_uid => params[:auth_uid])
 
-      flash.now[:notice] = render_to_string :partial => "auth_association"
-
-      # validate before displaying to show email field if it conflicts
-      flash.now[:notice] = t ".duplicate_social_email" unless current_user.valid? && current_user.errors[:email].empty?
+      if current_user.valid? || current_user.errors[:email].empty?
+        flash.now[:notice] = render_to_string :partial => "auth_association"
+      else
+        flash.now[:warning] = t ".duplicate_social_email"
+      end
     else
       check_signup_allowed