Skip to content

Commit e54785d

Browse files
author
ishanray
authored
Merge pull request #53 from Shopify/add-scope
Add collaborator scope
2 parents 72e855e + 4b770ba commit e54785d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## v1.0.6
4+
* [#53](https://github.com/Shopify/shopify-theme-inspector/pull/53) Add collaborator scope
5+
36
## v1.0.5
47
* [#49](https://github.com/Shopify/shopify-theme-inspector/pull/49) Local development url detect
58
* [#52](https://github.com/Shopify/shopify-theme-inspector/pull/52) Allow search path profiling

src/background.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import {env} from './env';
22
import {isDev, Oauth2} from './utils';
33

44
const DEVTOOLS_SCOPE = 'https://api.shopify.com/auth/shop.storefront.devtools';
5+
const COLLABORATORS_SCOPE =
6+
'https://api.shopify.com/auth/partners.collaborator-relationships.readonly';
57

68
function getOauth2Client(origin: string) {
79
const identityDomain = isDev(origin)
@@ -13,7 +15,9 @@ function getOauth2Client(origin: string) {
1315
const subjectId = isDev(origin)
1416
? env.DEV_OAUTH2_SUBJECT_ID
1517
: env.OAUTH2_SUBJECT_ID;
16-
const clientAuthParams = [['scope', `openid profile ${DEVTOOLS_SCOPE}`]];
18+
const clientAuthParams = [
19+
['scope', `openid profile ${DEVTOOLS_SCOPE} ${COLLABORATORS_SCOPE}`],
20+
];
1721

1822
return new Oauth2(clientId, subjectId, identityDomain, {clientAuthParams});
1923
}
@@ -95,7 +99,7 @@ chrome.runtime.onMessage.addListener(({type, origin}, _, sendResponse) => {
9599
}
96100

97101
const oauth2 = getOauth2Client(origin);
98-
const params = [['scope', DEVTOOLS_SCOPE]];
102+
const params = [['scope', `${DEVTOOLS_SCOPE} ${COLLABORATORS_SCOPE}`]];
99103
const destination = `${origin}/admin`;
100104

101105
oauth2

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Shopify Theme Inspector for Chrome",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Profile and debug Liquid template on your Shopify store",
55
"devtools_page": "devtools.html",
66
"permissions": ["storage", "identity", "activeTab"],

0 commit comments

Comments
 (0)