@@ -2,6 +2,8 @@ import {env} from './env';
2
2
import { isDev , Oauth2 } from './utils' ;
3
3
4
4
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' ;
5
7
6
8
function getOauth2Client ( origin : string ) {
7
9
const identityDomain = isDev ( origin )
@@ -13,7 +15,9 @@ function getOauth2Client(origin: string) {
13
15
const subjectId = isDev ( origin )
14
16
? env . DEV_OAUTH2_SUBJECT_ID
15
17
: env . OAUTH2_SUBJECT_ID ;
16
- const clientAuthParams = [ [ 'scope' , `openid profile ${ DEVTOOLS_SCOPE } ` ] ] ;
18
+ const clientAuthParams = [
19
+ [ 'scope' , `openid profile ${ DEVTOOLS_SCOPE } ${ COLLABORATORS_SCOPE } ` ] ,
20
+ ] ;
17
21
18
22
return new Oauth2 ( clientId , subjectId , identityDomain , { clientAuthParams} ) ;
19
23
}
@@ -95,7 +99,7 @@ chrome.runtime.onMessage.addListener(({type, origin}, _, sendResponse) => {
95
99
}
96
100
97
101
const oauth2 = getOauth2Client ( origin ) ;
98
- const params = [ [ 'scope' , DEVTOOLS_SCOPE ] ] ;
102
+ const params = [ [ 'scope' , ` ${ DEVTOOLS_SCOPE } ${ COLLABORATORS_SCOPE } ` ] ] ;
99
103
const destination = `${ origin } /admin` ;
100
104
101
105
oauth2
0 commit comments