Skip to content

Commit 1824858

Browse files
committed
Stores scopes on provider so when config is reparsed when setting store they don't dup
1 parent 36d84fc commit 1824858

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: providers/shopify/shopify.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type Provider struct {
3333
config *oauth2.Config
3434
providerName string
3535
shopName string
36+
scopes []string
3637
}
3738

3839
// New creates a new Shopify provider and sets up important connection details.
@@ -44,6 +45,7 @@ func New(clientKey, secret, callbackURL string, scopes ...string) *Provider {
4445
Secret: secret,
4546
CallbackURL: callbackURL,
4647
providerName: providerName,
48+
scopes: scopes,
4749
}
4850
p.config = newConfig(p, scopes)
4951
return p
@@ -69,7 +71,7 @@ func (p *Provider) SetShopName(name string) {
6971
p.shopName = name
7072

7173
// Reparse config with the new shop name.
72-
p.config = newConfig(p, p.config.Scopes)
74+
p.config = newConfig(p, p.scopes)
7375
}
7476

7577
// Debug is a no-op for the Shopify package.

0 commit comments

Comments
 (0)