Skip to content

Commit

Permalink
Stores scopes on provider so when config is reparsed when setting sto…
Browse files Browse the repository at this point in the history
…re they don't dup
  • Loading branch information
mattevans committed Jun 14, 2019
1 parent 36d84fc commit 1824858
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion providers/shopify/shopify.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Provider struct {
config *oauth2.Config
providerName string
shopName string
scopes []string
}

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

// Reparse config with the new shop name.
p.config = newConfig(p, p.config.Scopes)
p.config = newConfig(p, p.scopes)
}

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

0 comments on commit 1824858

Please sign in to comment.