omniauth-klaviyo 0.1.0 → 0.1.1
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 +4 -4
- data/.rubocop.yml +3 -0
- data/lib/omniauth/klaviyo/version.rb +1 -1
- data/lib/omniauth/klaviyo.rb +2 -0
- data/lib/omniauth/strategies/klaviyo.rb +10 -9
- data/lib/omniauth-klaviyo.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49a5680e3b676eded2807eccdfdf0ecc7b7e0689977bc30f35da549d75ade7c8
|
4
|
+
data.tar.gz: 25f57d4ed39c0d934b0b9dcec87580ede98c31872fc67c6180cdc1ca62cc4235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79640e02f83b7320711e120d7e372f71c8b3befb7cd0b4a2f05c71f4f22c102431d17a85a76e0accb11792f04a8bd5b706eea2ef36b2c816bb09b78bdee99199
|
7
|
+
data.tar.gz: d992f42e81b229ceb4025e7735a6ad4a1551be8c5addd0f102676baff9d5c84e4b0ce222ddc4a158e36aedd32dfc9f111764debd2b4b949596524cfe366c9cb1
|
data/.rubocop.yml
CHANGED
data/lib/omniauth/klaviyo.rb
CHANGED
@@ -1,31 +1,32 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "omniauth-oauth2"
|
4
4
|
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
|
+
# OmniAuth strategy for Klaviyo OAuth2 authentication.
|
8
|
+
# This class handles the authorization and callback process for Klaviyo.
|
7
9
|
class Klaviyo < OmniAuth::Strategies::OAuth2
|
10
|
+
DEFAULT_REVISION = "2024-10-15"
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
option :name, 'klaviyo'
|
12
|
+
option :name, "klaviyo"
|
12
13
|
|
13
14
|
option :pkce, true
|
14
15
|
|
15
16
|
option :client_options, {
|
16
|
-
site:
|
17
|
-
authorize_url:
|
18
|
-
token_url:
|
17
|
+
site: "https://a.klaviyo.com",
|
18
|
+
authorize_url: "https://www.klaviyo.com/oauth/authorize",
|
19
|
+
token_url: "https://a.klaviyo.com/oauth/token"
|
19
20
|
}
|
20
21
|
|
21
22
|
def callback_url
|
22
23
|
full_host + script_name + callback_path
|
23
24
|
end
|
24
25
|
|
25
|
-
uid { raw_info[
|
26
|
+
uid { raw_info["id"] }
|
26
27
|
|
27
28
|
def raw_info
|
28
|
-
response = access_token.get(
|
29
|
+
response = access_token.get("/api/accounts", headers: { "revision" => DEFAULT_REVISION }).parsed
|
29
30
|
@raw_info ||= response.dig("data", 0) || {}
|
30
31
|
end
|
31
32
|
end
|
data/lib/omniauth-klaviyo.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-klaviyo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Morad Boukhari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|