Skip to content

Commit e102716

Browse files
authored
Merge pull request #6153 from Shopify/07-23-provide_error_when_using_non-theme_access_app_password
Provide error when using non-theme access app password
2 parents bf2fc00 + 52f999f commit e102716

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.changeset/gorgeous-students-work.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/theme': patch
3+
---
4+
5+
Provide error when using non-theme access app password

packages/theme/src/cli/flags.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {Flags} from '@oclif/core'
22
import {normalizeStoreFqdn} from '@shopify/cli-kit/node/context/fqdn'
3+
import {AbortError} from '@shopify/cli-kit/node/error'
34
import {resolvePath, cwd} from '@shopify/cli-kit/node/path'
45

56
/**
@@ -17,6 +18,13 @@ export const themeFlags = {
1718
password: Flags.string({
1819
description: 'Password generated from the Theme Access app.',
1920
env: 'SHOPIFY_CLI_THEME_TOKEN',
21+
parse: async (input) => {
22+
if (input.startsWith('shptka_')) {
23+
return input
24+
}
25+
26+
throw new AbortError('Invalid password. Please generate a new password from the Theme Access app.')
27+
},
2028
}),
2129
store: Flags.string({
2230
char: 's',

0 commit comments

Comments
 (0)