lib/omniauth/strategies/oauth2.rb in oa-oauth-0.2.0.beta4 vs lib/omniauth/strategies/oauth2.rb in oa-oauth-0.2.0.beta5

- old
+ new

@@ -62,19 +62,19 @@ if request.params['error'] || request.params['error_reason'] raise CallbackError.new(request.params['error'], request.params['error_description'] || request.params['error_reason'], request.params['error_uri']) end verifier = request.params['code'] - @access_token = client.web_server.get_access_token(verifier, :redirect_uri => callback_url) + @access_token = client.web_server.get_access_token(verifier, {:redirect_uri => callback_url}.merge(options)) if @access_token.expires? && @access_token.expires_in <= 0 client.request(:post, client.access_token_url, { 'client_id' => client_id, 'grant_type' => 'refresh_token', 'client_secret' => client_secret, 'refresh_token' => @access_token.refresh_token - }) - @access_token = client.web_server.get_access_token(verifier, :redirect_uri => callback_url) + }.merge(options)) + @access_token = client.web_server.get_access_token(verifier, {:redirect_uri => callback_url}.merge(options)) end super rescue ::OAuth2::HTTPError, ::OAuth2::AccessDenied, CallbackError => e fail!(:invalid_credentials, e)