From 720f6868da095fa1b74985c1fd6c1486cb4af276 Mon Sep 17 00:00:00 2001 From: ycfxx Date: Sat, 5 Feb 2022 21:13:36 +0800 Subject: [PATCH] upgrade shopify OAuth process --- .../shopify/auth/web/ShopifyAuthTemplateController.java | 4 ++-- src/main/resources/application-dev.yml | 2 +- src/main/resources/templates/shopify/auth_back.html | 1 + src/main/ui/static/shopify/auth/templates/auth_root.html | 1 + src/main/ui/static/shopify/auth/templates/shopify_auth.html | 1 + src/main/ui/static/shopify/auth/templates/shopify_login.html | 1 + .../ui/static/shopify/auth/templates/shopify_register.html | 1 + 7 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java index f4443d1ce..f23ae4c19 100644 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java +++ b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/web/ShopifyAuthTemplateController.java @@ -67,7 +67,7 @@ public class ShopifyAuthTemplateController { * @return */ @GetMapping("/auth/back") - public RedirectView shopifyStoreAuthRedirect(@RequestParam("code") String code, + public String shopifyStoreAuthRedirect(@RequestParam("code") String code, @RequestParam("hmac") String hmac, @RequestParam("host") String host, @RequestParam("state") String state, @@ -98,7 +98,7 @@ public class ShopifyAuthTemplateController { String redirectUri = PlatformEnvironment.getEnv().concatUrl("/auth.html#/shopify/login?code=" + code + "&hmac=" + hmac + "&host=" + host + "&state=" + state + "&shop=" + shop + "×tamp=" + timestamp); response.setHeader("content-security-policy", "frame-ancestors https://" + shop + ".myshopify.com https://admin.shopify.com"); - return new RedirectView(redirectUri); + return "redirect:" + redirectUri; } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 7180250b5..187beb9e6 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -73,7 +73,7 @@ spring: app: run-tasks: false host: - main: https://1c6d-222-95-180-118.ngrok.io/ + main: https://65e5-222-95-183-204.ngrok.io/ regions: au: http://dalong-au.dev.rpaygroup.com/ cn: http://dalong-au.dev.rpaygroup.com/ diff --git a/src/main/resources/templates/shopify/auth_back.html b/src/main/resources/templates/shopify/auth_back.html index afe68c072..ddb681f82 100644 --- a/src/main/resources/templates/shopify/auth_back.html +++ b/src/main/resources/templates/shopify/auth_back.html @@ -2,6 +2,7 @@ + Auth diff --git a/src/main/ui/static/shopify/auth/templates/auth_root.html b/src/main/ui/static/shopify/auth/templates/auth_root.html index ccb6db5c9..02274e3b8 100644 --- a/src/main/ui/static/shopify/auth/templates/auth_root.html +++ b/src/main/ui/static/shopify/auth/templates/auth_root.html @@ -2,6 +2,7 @@ + Title