X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/64604a852f941a2c30aef909073b4f6925c622fa..22e079a3c3c98fe3cf3b727732af0b2c92ff075f:/lib/oauth.rb diff --git a/lib/oauth.rb b/lib/oauth.rb index 7ff2ba8b4..0456c0873 100644 --- a/lib/oauth.rb +++ b/lib/oauth.rb @@ -1,6 +1,7 @@ module Oauth SCOPES = %w[read_prefs write_prefs write_diary write_api read_gpx write_gpx write_notes].freeze PRIVILEGED_SCOPES = %w[read_email skip_authorization].freeze + OAUTH2_SCOPES = %w[openid].freeze class Scope attr_reader :name @@ -14,9 +15,10 @@ module Oauth end end - def self.scopes(privileged: false) + def self.scopes(oauth2: false, privileged: false) scopes = SCOPES scopes += PRIVILEGED_SCOPES if privileged + scopes += OAUTH2_SCOPES if oauth2 scopes.collect { |s| Scope.new(s) } end end