authkeeper 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc7ae5d07c1884c346b471c2544044d042579ca4da69350887b654ab3b27a404
4
- data.tar.gz: ede7994f9a7449091488b9a0fcd5ecb7d42496bf1094b327500a7e24a2070f2f
3
+ metadata.gz: d7e3d45ae7bcca438a4237c560263cba833d3d41c9dae190345f9fb45851a2ba
4
+ data.tar.gz: 13a0894bf0629edc822a341a150e34868f11e1bea9ea8716cf83ac75295ec3b2
5
5
  SHA512:
6
- metadata.gz: 8e27b133c53d951fba9dc9c8167b908ebea118eaf0289915e8d8ef4318621b07f2be929a5d9a54bbadd6f169cc0db22be60a69a318ae825d2c90b5c69786367e
7
- data.tar.gz: 4a2729b12b89b87f14d4be182c9b444c4dfe2a39fc95ec8bdea3edf9c29881d5e782695e89a8c8bad1487985d1258b6c942d92329222d95ad4e720861cb2d2e9
6
+ metadata.gz: 4f5f3223c51f25c51e54949b84c3cf4485f8337f22956bb9170b61bb219508ae68fb5b9087ab64dee59bed0d1d93c3835f754217c88024a2d4bf893106ca0e0f
7
+ data.tar.gz: 6f62a8506fd37f9bcaf8240629ef027d78406f8df2535021994a36b289700b55e8ab985feba0001cce11731f96137be904ac8e51139f39a1076a07a9011a49b8
@@ -3,7 +3,7 @@
3
3
  module Authkeeper
4
4
  module VkAuthApi
5
5
  class Client < HttpService::Client
6
- include Requests::FetchAccessToken
6
+ include Requests::AccessToken
7
7
  include Requests::Info
8
8
 
9
9
  BASE_URL = 'https://id.vk.com/'
@@ -5,7 +5,7 @@ require 'uri'
5
5
  module Authkeeper
6
6
  module VkAuthApi
7
7
  module Requests
8
- module FetchAccessToken
8
+ module AccessToken
9
9
  def fetch_access_token(client_id:, redirect_url:, device_id:, code:, state:, code_verifier:)
10
10
  post(
11
11
  path: 'oauth2/auth',
@@ -23,6 +23,22 @@ module Authkeeper
23
23
  }
24
24
  )
25
25
  end
26
+
27
+ def refresh_access_token(client_id:, refresh_token:, device_id:, state:)
28
+ post(
29
+ path: 'oauth2/auth',
30
+ body: URI.encode_www_form({
31
+ grant_type: 'refresh_token',
32
+ client_id: client_id,
33
+ device_id: device_id,
34
+ refresh_token: refresh_token,
35
+ state: state
36
+ }),
37
+ headers: {
38
+ 'Content-Type' => 'application/x-www-form-urlencoded'
39
+ }
40
+ )
41
+ end
26
42
  end
27
43
  end
28
44
  end
@@ -17,7 +17,7 @@ module Authkeeper
17
17
  # "expires_in" => 3600,
18
18
  # "user_id" => 176780000,
19
19
  # "state" => "ce4a09792e2cc8065a96074906709765",
20
- # "scope" => "vkid.personal_info email"
20
+ # "scope" => "vkid.personal_info email phone ads"
21
21
  # }
22
22
 
23
23
  user_info = fetch_user_info(auth_info['access_token'])
@@ -36,7 +36,7 @@ module Authkeeper
36
36
 
37
37
  {
38
38
  result: {
39
- auth_info: auth_info.symbolize_keys,
39
+ auth_info: auth_info.symbolize_keys.merge(device_id: params[:device_id]),
40
40
  user_info: {
41
41
  uid: user_info.dig('user', 'user_id'),
42
42
  provider: 'vk',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Authkeeper
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
@@ -53,7 +53,7 @@ files:
53
53
  - app/lib/authkeeper/google_auth_api/requests/fetch_access_token.rb
54
54
  - app/lib/authkeeper/jwt_encoder.rb
55
55
  - app/lib/authkeeper/vk_auth_api/client.rb
56
- - app/lib/authkeeper/vk_auth_api/requests/fetch_access_token.rb
56
+ - app/lib/authkeeper/vk_auth_api/requests/access_token.rb
57
57
  - app/lib/authkeeper/vk_auth_api/requests/info.rb
58
58
  - app/lib/authkeeper/yandex_api/client.rb
59
59
  - app/lib/authkeeper/yandex_api/requests/info.rb