File tree Expand file tree Collapse file tree 3 files changed +12
-19
lines changed
packages/theme/src/cli/services Expand file tree Collapse file tree 3 files changed +12
-19
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @shopify/theme ' : patch
3+ ---
4+
5+ Return error when running theme profile using a themekit access password
Original file line number Diff line number Diff line change @@ -127,15 +127,8 @@ describe('profile', () => {
127127 // Then
128128 await expect ( result ) . rejects . toThrow (
129129 new AbortError (
130- 'Unable to use Admin API tokens with the profile command' ,
131- `To use this command with the --password flag you must:
132-
133- 1. Install the Theme Access app on your shop
134- 2. Generate a new password
135-
136- Alternatively, you can authenticate normally by not passing the --password flag.
137-
138- Learn more: https://shopify.dev/docs/storefronts/themes/tools/theme-access` ,
130+ 'Unable to use Admin API or Theme Access tokens with the profile command' ,
131+ 'You can authenticate normally by not passing the --password flag.' ,
139132 ) ,
140133 )
141134 } )
Original file line number Diff line number Diff line change @@ -22,17 +22,12 @@ export async function profile(
2222 ? await ensureValidPassword ( storefrontPassword , adminSession . storeFqdn )
2323 : undefined
2424
25- if ( themeAccessPassword ?. startsWith ( 'shpat_' ) ) {
26- throw new AbortError (
27- 'Unable to use Admin API tokens with the profile command' ,
28- `To use this command with the --password flag you must:
29-
30- 1. Install the Theme Access app on your shop
31- 2. Generate a new password
25+ const isUnsupportedToken = [ 'shpat_' , 'shptka_' ] . some ( ( prefix ) => themeAccessPassword ?. startsWith ( prefix ) )
3226
33- Alternatively, you can authenticate normally by not passing the --password flag.
34-
35- Learn more: https://shopify.dev/docs/storefronts/themes/tools/theme-access` ,
27+ if ( isUnsupportedToken ) {
28+ throw new AbortError (
29+ 'Unable to use Admin API or Theme Access tokens with the profile command' ,
30+ 'You can authenticate normally by not passing the --password flag.' ,
3631 )
3732 }
3833
You can’t perform that action at this time.
0 commit comments