Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix impact nil class issue in omniauth gem #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/omniauth/strategies/yahoo_oauth2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module OmniAuth
module Strategies
class YahooOauth2 < OmniAuth::Strategies::OAuth2
option :name, 'yahoo_oauth2'

option :client_options, {
site: 'https://api.login.yahoo.com',
authorize_url: '/oauth2/request_auth',
Expand All @@ -30,16 +30,15 @@ class YahooOauth2 < OmniAuth::Strategies::OAuth2

def build_access_token
verifier = request.params['code']

auth = "Basic #{Base64.strict_encode64("#{options.client_id}:#{options.client_secret}")}"

token = client.get_token(
{ redirect_uri: callback_url, code: verifier, grant_type: 'authorization_code', headers: { 'Authorization' => auth } }.
merge(token_params.to_hash(symbolize_keys: true)), deep_symbolize(options.auth_token_params))

merge(token_params.to_hash(symbolize_keys: true)), deep_symbolize(options.auth_token_params || {}))
token
end

def raw_info
raw_info_url = "https://social.yahooapis.com/v1/user/#{uid}/profile?format=json"
@raw_info ||= access_token.get(raw_info_url).parsed
Expand Down