Skip to content

Commit

Permalink
Merge pull request #90 from mamantoha/develop
Browse files Browse the repository at this point in the history
Explicitly set request_body OAuth2 auth scheme
  • Loading branch information
mamantoha authored Jan 25, 2023
2 parents 3ce56fd + 8bf7425 commit f6032b9
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
strategy:
matrix:
ruby: [2.6, 2.7, 3.0, 3.1, head, jruby, jruby-head]
ruby: [2.7, 3.0, 3.1, 3.2, head, jruby, jruby-head]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
AllCops:
NewCops: enable
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
Layout/LineLength:
Max: 120
Metrics/MethodLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Max: 101
Enabled: false
Lint/DuplicateBranch:
Enabled: false
Naming/FileName:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2011-2022 Anton Maminov
Copyright (c) 2011-2023 Anton Maminov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Tested with the following Ruby versions:

## License

Copyright: 2011-2022 Anton Maminov ([email protected])
Copyright: 2011-2023 Anton Maminov ([email protected])

This library is distributed under the MIT license. Please see the LICENSE file.

Expand Down
1 change: 0 additions & 1 deletion examples/main.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'pp'
require 'sinatra'
require 'omniauth'
require 'omniauth-vkontakte'
Expand Down
10 changes: 6 additions & 4 deletions lib/omniauth/strategies/vkontakte.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ class NoRawData < StandardError; end

option :name, 'vkontakte'

option :client_options,
site: 'https://api.vk.com/',
token_url: 'https://oauth.vk.com/access_token',
authorize_url: 'https://oauth.vk.com/authorize'
option :client_options, {
site: 'https://api.vk.com/',
token_url: 'https://oauth.vk.com/access_token',
authorize_url: 'https://oauth.vk.com/authorize',
auth_scheme: :request_body
}

option :authorize_options, %i[scope display]

Expand Down
2 changes: 1 addition & 1 deletion lib/omniauth/vkontakte/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module OmniAuth
module Vkontakte
VERSION = '1.8.0'
VERSION = '1.8.1'
end
end
2 changes: 1 addition & 1 deletion omniauth-vkontakte.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.name = 'omniauth-vkontakte'
gem.require_paths = ['lib']
gem.version = OmniAuth::Vkontakte::VERSION
gem.required_ruby_version = '>= 2.6.0'
gem.required_ruby_version = '>= 2.7.0'
gem.add_runtime_dependency 'omniauth-oauth2', '>= 1.5', '<= 1.8.0'
gem.metadata['rubygems_mfa_required'] = 'true'
end
4 changes: 4 additions & 0 deletions spec/omniauth/strategies/vkontakte_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
it 'should have correct token url' do
expect(subject.options.client_options.token_url).to eq('https://oauth.vk.com/access_token')
end

it 'should have correct auth_scheme' do
expect(subject.options.client_options.auth_scheme).to eq(:request_body)
end
end

describe 'info' do
Expand Down

0 comments on commit f6032b9

Please sign in to comment.