Documentation Error - Hostname Regex Validation

Highlighted
New Member
1 0 1

The [docs](https://shopify.dev/tutorials/authenticate-with-oauth#step-3-confirm-installation) provide a regex of

 

 

/(https|http)\:\/\/[a-zA-Z0-9][a-zA-Z0-9\-]*\.myshopify\.com[\/]?/

 

 

which takes into account the protocol (https|http), but it looks like the hostname from the oauth responses doesn't provide a protocol (eg, `widgets-shop.myshopify.com`).

 

I'm only in development mode, so it might be different in production. Can someone confirm that this is the correct Regex to verify hostnames during the oauth flow.

 

edit: Using this regex until someone confirms the correct hostname structure:

 

/[a-zA-Z0-9][a-zA-Z0-9\-]*\.myshopify\.com[\/]?/

 

 

1 Like
Highlighted
New Member
2 0 0

I would also like to know the answer to this.

The docs specify a a regex that pertains to a protocol within shop query parameter , however the actual query parameter doesn't contain one.

Thanks for the regex nickk2.

0 Likes
Highlighted
Trailblazer
134 12 22

I posted this same thing last month: https://community.shopify.com/c/Shopify-APIs-SDKs/Error-in-hostname-regexp-example-in-OAuth2-documen.... No response from Shopify. 

The hostname in production also doesn't include http / https.

1 Like