From e79129051ec42a0754460f8aa93b944f2602c180 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 7 Dec 2023 18:17:51 +0800 Subject: [PATCH] Direct login --- src/pages/Payment/FPS/FPSTest.js | 5 +++-- .../auth-forms/AuthLoginCustom.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/pages/Payment/FPS/FPSTest.js b/src/pages/Payment/FPS/FPSTest.js index 256a8e6..a97f068 100644 --- a/src/pages/Payment/FPS/FPSTest.js +++ b/src/pages/Payment/FPS/FPSTest.js @@ -45,7 +45,7 @@ const Index = () => { const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState(""); const [browserType, setBrowserType] = React.useState(""); const mobileBrowser = "Mobile"; - // const desktopBrowser = "Desktop"; + const desktopBrowser = "Desktop"; // const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD // const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing // const loadPaymentUrl = "/api/payment/wallet/fps"; @@ -67,11 +67,12 @@ const Index = () => { if (/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)) { console.log('Mobile web browser'); setBrowserType(mobileBrowser) + setFpsqrcodeurl(openPASGUrl) console.log(openPASGUrl) // renderOpenFPSPaymentAppTemplate(openPASGUrl, $('#openFPSPaymentAppTemplate').html()); } else { console.log('Desktop web browser'); - setBrowserType(mobileBrowser) + setBrowserType(desktopBrowser) const parsedUrl = new URL("http://127.0.0.1:8080/api/payment/wallet/fps/enquiryfpspayload/vm.JKDDlTOavR3ASviSwUnS1Lw4-"); console.log(parsedUrl) const fpsqrcodeurl = parsedUrl.pathname; diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index ca13486..74fe1a8 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -182,6 +182,20 @@ const AuthLoginCustom = () => { window.location.assign(url); } + const openApp = () => { + let callbackUrl = "https://"+iAmSmartCallbackPath()+"/iamsmart/authcallback"; + let url = "hk.gov.iamsmart.testapp://" +"auth" + + "?clientID=" + clientId + + "&responseType=code" + +"&source=" + getBowerType() + +"&redirectURI="+encodeURIComponent(callbackUrl) + +"&scope="+encodeURIComponent("eidapi_auth eidapi_profiles") + +"&lang=zh-HK"//en-US, zh-HK, or zh-CN + //+"&state=" + +"&brokerPage=false" + window.location.assign(url); + } + return ( @@ -280,6 +294,11 @@ const AuthLoginCustom = () => { + + + + + {"了解更多 >"}