From: Milan Cvetkovic Date: Mon, 14 Aug 2023 08:42:14 +0000 (+0000) Subject: Replace references to windowslive with microsoft_graph X-Git-Tag: live~1122^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/568bf4939d8a60a87018f1fb07edc881c608b4ce Replace references to windowslive with microsoft_graph --- diff --git a/app/assets/images/windowslive.svg b/app/assets/images/microsoft_graph.svg similarity index 100% rename from app/assets/images/windowslive.svg rename to app/assets/images/microsoft_graph.svg diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dbc621fab..769f3d411 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -250,7 +250,7 @@ class UsersController < ApplicationController when "openid" uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) || uid.match(%r{https://me.yahoo.com/(.*)}) - when "google", "facebook", "windowslive" + when "google", "facebook", "microsoft_graph" true else false diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 80537bad5..5ea638e2f 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -36,7 +36,7 @@
  • <%= auth_button "facebook", "facebook" %>
  • <% end -%> <% if Settings.key?(:microsoft_graph_auth_id) -%> -
  • <%= auth_button "windowslive", "windowslive" %>
  • +
  • <%= auth_button "microsoft_graph", "microsoft_graph" %>
  • <% end -%> <% if Settings.key?(:github_auth_id) -%>
  • <%= auth_button "github", "github" %>
  • diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 81d4747e9..ee5be2abd 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -24,7 +24,7 @@ end openid_options = { :name => "openid", :store => openid_store } google_options = { :name => "google", :scope => "email", :access_type => "online" } facebook_options = { :name => "facebook", :scope => "email", :client_options => { :site => "https://graph.facebook.com/v4.0", :authorize_url => "https://www.facebook.com/v4.0/dialog/oauth" } } -microsoft_graph_options = { :name => "windowslive", :scope => "openid User.Read" } +microsoft_graph_options = { :name => "microsoft_graph", :scope => "openid User.Read" } github_options = { :name => "github", :scope => "user:email" } wikipedia_options = { :name => "wikipedia", :client_options => { :site => "https://meta.wikimedia.org" } } diff --git a/config/locales/en.yml b/config/locales/en.yml index e14c5806c..8b11f6399 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -212,7 +212,7 @@ en: openid: OpenID google: Google facebook: Facebook - windowslive: Microsoft + microsoft_graph: Microsoft github: GitHub wikipedia: Wikipedia api: @@ -1785,7 +1785,7 @@ en: facebook: title: Login with Facebook alt: Login with a Facebook Account - windowslive: + microsoft_graph: title: Login with Microsoft alt: Login with a Microsoft Account github: diff --git a/lib/auth.rb b/lib/auth.rb index 0ed00729f..4d1356e2b 100644 --- a/lib/auth.rb +++ b/lib/auth.rb @@ -8,7 +8,7 @@ module Auth }.tap do |providers| providers[I18n.t("auth.providers.google")] = "google" if Settings.key?(:google_auth_id) providers[I18n.t("auth.providers.facebook")] = "facebook" if Settings.key?(:facebook_auth_id) - providers[I18n.t("auth.providers.windowslive")] = "windowslive" if Settings.key?(:microsoft_graph_auth_id) + providers[I18n.t("auth.providers.microsoft_graph")] = "microsoft_graph" if Settings.key?(:microsoft_graph_auth_id) providers[I18n.t("auth.providers.github")] = "github" if Settings.key?(:github_auth_id) providers[I18n.t("auth.providers.wikipedia")] = "wikipedia" if Settings.key?(:wikipedia_auth_id) end.freeze