|
|
|
@ -38,13 +38,14 @@ public class ShopifyAuthTemplateController {
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/auth")
|
|
|
|
|
@ShopifyEndpoint
|
|
|
|
|
public String shopifyStorePermission(@RequestParam("shop") String shop,
|
|
|
|
|
@RequestParam("hmac") String hmac,
|
|
|
|
|
public String shopifyStorePermission(@RequestParam("hmac") String hmac,
|
|
|
|
|
@RequestParam("host") String host,
|
|
|
|
|
@RequestParam("shop") String shop,
|
|
|
|
|
@RequestParam("timestamp") String timestamp) {
|
|
|
|
|
if (!Pattern.matches("^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", shop)) {
|
|
|
|
|
throw new BadRequestException("Parameter shop is invalid.");
|
|
|
|
|
}
|
|
|
|
|
if (!shopifyRequestValidator.verifyPermission(shop, hmac, timestamp)) {
|
|
|
|
|
if (!shopifyRequestValidator.verifyPermission(shop, hmac, timestamp,host)) {
|
|
|
|
|
throw new ShopifyRequestVerifyException("This request parameters is invalid");
|
|
|
|
|
}
|
|
|
|
|
ShopifyPermissionURL shopifyPermissionURL = shopifyMerchantAuthApplication.getShopifyPermissionUrl(shop);
|
|
|
|
|