Skip to content

Commit ec2c02b

Browse files
committed
fix(shopify): disallow trailing hyphen in shop subdomain regex
1 parent a07e652 commit ec2c02b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/lib/api/contracts/oauth-connections.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const oauthAuthorizeParamsResponseSchema = z.object({
143143
response_type: z.literal('code'),
144144
})
145145

146-
const SHOPIFY_SHOP_DOMAIN_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]*\.myshopify\.com$/
146+
const SHOPIFY_SHOP_DOMAIN_REGEX = /^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.myshopify\.com$/
147147
export const shopifyShopDomainSchema = z.string().regex(SHOPIFY_SHOP_DOMAIN_REGEX)
148148

149149
export const listOAuthConnectionsContract = defineRouteContract({

0 commit comments

Comments
 (0)