class OmniAuth::Strategies::Bitbucket

Constants

ACCOUNT
EMAIL

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/bitbucket.rb, line 15
def authorize_params
  super.tap do |params|
    scope = params[:scope].to_s.split(/\s+/)
    scope << EMAIL unless scope.include?(EMAIL)
    scope << ACCOUNT unless scope.include?(ACCOUNT)
    params[:scope] = scope.join(" ")
  end
end
callback_url() click to toggle source
# File lib/omniauth/strategies/bitbucket.rb, line 24
def callback_url
  full_host + script_name + callback_path
end
emails() click to toggle source
# File lib/omniauth/strategies/bitbucket.rb, line 55
def emails
  @emails ||= deep_symbolize(access_token.get("/api/2.0/user/emails").parsed).fetch(:values)
end
primary_email() click to toggle source
# File lib/omniauth/strategies/bitbucket.rb, line 59
def primary_email
  (emails.find {|info| info["is_primary"] } || {})["email"]
end
raw_info() click to toggle source
# File lib/omniauth/strategies/bitbucket.rb, line 51
def raw_info
  @raw_info ||= deep_symbolize(access_token.get("/api/2.0/user").parsed)
end