From 2a1f7d19fa76ed4cf599c53b2f28a19e9c1e0328 Mon Sep 17 00:00:00 2001 From: malithie Date: Thu, 25 Apr 2024 12:40:37 +0530 Subject: [PATCH] add a config to add myaccount app url as it is different from base path in asgardeo. --- petcare-sample/b2c/web-app/petdesk/web/react/config.js | 1 + .../b2c/web-app/petdesk/web/react/src/components/UserMenu.tsx | 2 +- .../b2c/web-app/petdesk/web/react/src/util/getConfig.tsx | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/petcare-sample/b2c/web-app/petdesk/web/react/config.js b/petcare-sample/b2c/web-app/petdesk/web/react/config.js index 44987d376..77dfb2b2d 100644 --- a/petcare-sample/b2c/web-app/petdesk/web/react/config.js +++ b/petcare-sample/b2c/web-app/petdesk/web/react/config.js @@ -3,6 +3,7 @@ window.config = { clientID: "", signInRedirectURL: "http://localhost:5173", signOutRedirectURL: "http://localhost:5173", + myAccountAppURL: "", resourceServerURL: "http://localhost:9090", scope: ["openid", "email", "profile"] }; diff --git a/petcare-sample/b2c/web-app/petdesk/web/react/src/components/UserMenu.tsx b/petcare-sample/b2c/web-app/petdesk/web/react/src/components/UserMenu.tsx index 555ffa155..f6043f4ea 100644 --- a/petcare-sample/b2c/web-app/petdesk/web/react/src/components/UserMenu.tsx +++ b/petcare-sample/b2c/web-app/petdesk/web/react/src/components/UserMenu.tsx @@ -67,7 +67,7 @@ export default function MenuListComposition(props: { }; const gotoMyAccount = () => { - window.open(getConfig().baseUrl + '/myaccount', '_blank'); + window.open(getConfig().myAccountAppURL, '_blank'); }; return ( diff --git a/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx b/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx index 374269d9b..06b858816 100644 --- a/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx +++ b/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx @@ -22,6 +22,7 @@ interface Config { scope: string[]; signInRedirectURL: string; signOutRedirectURL: string; + myAccountAppURL: string; resourceServerURL: string; } @@ -36,6 +37,7 @@ const authConfig = { clientID: window.config.clientID, signInRedirectURL: window.config.signInRedirectURL, signOutRedirectURL: window.config.signOutRedirectURL, + myAccountAppURL: window.config.myAccountAppURL, resourceServerURL: window.config.resourceServerURL, scope: ["openid", "profile", "email"], };