]> git.openstreetmap.org Git - rails.git/blob - lib/auth.rb
Drop support for OAuth 1
[rails.git] / lib / auth.rb
1 module Auth
2   @providers = {}
3
4   def self.providers
5     @providers[I18n.locale] ||= {
6       I18n.t("auth.providers.openid") => "openid"
7     }.tap do |providers|
8       providers[I18n.t("auth.providers.google")] = "google" if Settings.key?(:google_auth_id)
9       providers[I18n.t("auth.providers.facebook")] = "facebook" if Settings.key?(:facebook_auth_id)
10       providers[I18n.t("auth.providers.microsoft")] = "microsoft" if Settings.key?(:microsoft_auth_id)
11       providers[I18n.t("auth.providers.github")] = "github" if Settings.key?(:github_auth_id)
12       providers[I18n.t("auth.providers.wikipedia")] = "wikipedia" if Settings.key?(:wikipedia_auth_id)
13     end.freeze
14   end
15 end