omniauth-tiktok-loginkit 1.0.0 → 1.2.0

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: 14307d7f8316391d78741534ff36b9106d68a78a9c3d9c274b1ef50beecc492d
4
- data.tar.gz: 991f4a4d4c7c9d372ddddedd52172b449cb79de06a72d0ded7a74f4b97b36f93
3
+ metadata.gz: 5faf04e9c367568132c0bec1556049fed6c880e3835d3c11be6c3be9cfcd60f2
4
+ data.tar.gz: 033cec6a5871db23ce159baef696073ab5ad432df3db1546a02a98096f4a5c28
5
5
  SHA512:
6
- metadata.gz: 262098690b9522f578d336d73ae980dfa2888499ff3658b3e865dc5b98c61e89dde673e18991b24cdc6c4c8f6449f16ca89d210e42e1099813adf32978561fb8
7
- data.tar.gz: f43ac4dd53af4eb1ae9bb02d8c91d839d672b08c84e382c2936e3e3c1d642b80e9436fa3178b40d8acde22260cc76c909bc54f96e9ec565f6022de887f7b9442
6
+ metadata.gz: 20e2145990aef6b8ae406fc80e8c7d074e2a1ff397c302a0e4f79bf5a8028687cd4edf4ba647a82ae6e29951ff24c6bcfb0b28dd9f4cb4bca49a291d80664cf7
7
+ data.tar.gz: ad559681e8b48b5a2a86490666ed16c0bd7cf7f402762e451d967d572539f0bb68cbbb58694293ed7cf0eb96c6935c93b7b4bfc5cd82373da84252a749a8df0a
data/.rubocop.yml CHANGED
@@ -10,4 +10,8 @@ Style/StringLiteralsInInterpolation:
10
10
 
11
11
  Naming/FileName:
12
12
  Exclude:
13
- - 'lib/omniauth-tiktok-loginkit.rb'
13
+ - 'lib/omniauth-tiktok-loginkit.rb'
14
+
15
+ Metrics/BlockLength:
16
+ Exclude:
17
+ - 'spec/**/*_spec.rb' # good test write long
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.8
1
+ 3.4.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.2.0] - 2025-12-23
4
+
5
+ - Allow overriding `redirect_uri` entirely by @JustinGranof
6
+
7
+ ## [1.1.0] - 2025-02-18
8
+
9
+ - add more fields in `user.info.stats` by @TakiKazuya
10
+
3
11
  ## [0.1.0] - 2024-04-13
4
12
 
5
13
  - Initial release
data/README.md CHANGED
@@ -1,11 +1,19 @@
1
1
  # omniauth-tiktok-loginkit
2
2
 
3
+ [![rspec](https://github.com/layerssss/omniauth-tiktok-loginkit/actions/workflows/rspec.yml/badge.svg)](https://github.com/layerssss/omniauth-tiktok-loginkit/actions/workflows/rspec.yml)
4
+ [![rubocop](https://github.com/layerssss/omniauth-tiktok-loginkit/actions/workflows/rubocop.yml/badge.svg)](https://github.com/layerssss/omniauth-tiktok-loginkit/actions/workflows/rubocop.yml)
5
+ [![Gem Version](https://badge.fury.io/rb/omniauth-tiktok-loginkit.svg)](https://badge.fury.io/rb/omniauth-tiktok-loginkit)
6
+
3
7
  OmniAuth Strategy for TikTok [LoginKit](https://developers.tiktok.com/doc/login-kit-overview/)
4
8
 
5
9
  Using TikTok Oauth API v2.
6
10
 
7
11
  ## Config
8
12
 
13
+ ```
14
+ gem "omniauth-tiktok-loginkit"
15
+ ```
16
+
9
17
  Configure with CLIENT_KEY and CLIENT_SECRET from TikTok Developers Portal (https://developers.tiktok.com/apps/). Note CLIENT_KEY is the value of "Client Key" field, not "App ID" on the portal.
10
18
 
11
19
  TikTok requires apps to be approved by review before it can access any APIs, including the Oauth APIs. Also any configuration change to the app will cause it to be back in "Staging" status. So please configure all neccessary "Redirect URI" correctly before submitting a review.
@@ -38,9 +46,10 @@ config.omniauth(
38
46
 
39
47
  ## Options
40
48
 
41
- * `name`: change endpoint to /auth/tiktok_another, /auth/tiktok_another/callback. default: `"tiktok_login"`
49
+ * `name`: change endpoint to /auth/tiktok_another, /auth/tiktok_another/callback. default: `"tiktok-loginkit"`
42
50
  * `skip_info`: skip User Info API call to retrieve `info` hash. default: `false`
43
51
  * `scope`: oauth scopes, seperated by comma. default: `"user.info.basic"`
52
+ * `redirect_uri`: change the redirect_uri used after the user authenticates with TikTok (overrides the `name` option)
44
53
 
45
54
 
46
55
  ## Usage
@@ -63,7 +63,7 @@ module OmniAuth
63
63
  end
64
64
 
65
65
  def callback_url
66
- full_host + callback_path
66
+ options[:redirect_uri] || (full_host + callback_path)
67
67
  end
68
68
 
69
69
  private
@@ -77,6 +77,9 @@ module OmniAuth
77
77
  if scopes.include?("user.info.profile")
78
78
  fields.push("profile_web_link", "profile_deep_link", "bio_description", "is_verified", "username")
79
79
  end
80
+ if scopes.include?("user.info.stats")
81
+ fields.push("follower_count", "following_count", "likes_count", "video_count")
82
+ end
80
83
  response = access_token
81
84
  .get(
82
85
  USER_INFO_URL,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniauthTiktokLoginkit
4
- VERSION = "1.0.0"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-tiktok-loginkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Yin
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-04-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: oauth2
@@ -52,7 +51,6 @@ dependencies:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
53
  version: '1.0'
55
- description:
56
54
  email:
57
55
  - layerssss@gmail.com
58
56
  executables: []
@@ -76,7 +74,6 @@ metadata:
76
74
  homepage_uri: https://github.com/layerssss/omniauth-tiktok-loginkit
77
75
  source_code_uri: https://github.com/layerssss/omniauth-tiktok-loginkit
78
76
  changelog_uri: https://github.com/layerssss/omniauth-tiktok-loginkit/blob/main/CHANGELOG.md
79
- post_install_message:
80
77
  rdoc_options: []
81
78
  require_paths:
82
79
  - lib
@@ -91,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
88
  - !ruby/object:Gem::Version
92
89
  version: '0'
93
90
  requirements: []
94
- rubygems_version: 3.5.3
95
- signing_key:
91
+ rubygems_version: 3.6.9
96
92
  specification_version: 4
97
93
  summary: OmniAuth Strategy for TikTok LoginKit
98
94
  test_files: []