From b54a74577b88afa1c0a989d6f5d0c4b6e1ceb4f6 Mon Sep 17 00:00:00 2001 From: Danh Date: Mon, 16 Oct 2023 17:46:15 +0700 Subject: [PATCH] sdk --- package.json | 2 +- src/pages/Oauth/AuthForm/EmailLoginForm.tsx | 7 ++++++- yarn.lock | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ece9fc321b..33bb5edb8a 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@blocto/web3-react-connector": "^1.0.0", "@coinbase/wallet-sdk": "^3.0.4", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", - "@kybernetwork/oauth2": "1.0.1-rc.3", + "@kybernetwork/oauth2": "1.0.1-rc.4", "@kyberswap/krystal-walletconnect-v2": "0.0.1", "@kyberswap/ks-sdk-classic": "^1.0.3", "@kyberswap/ks-sdk-core": "1.0.11", diff --git a/src/pages/Oauth/AuthForm/EmailLoginForm.tsx b/src/pages/Oauth/AuthForm/EmailLoginForm.tsx index afe11be9cf..96e6e2c1f4 100644 --- a/src/pages/Oauth/AuthForm/EmailLoginForm.tsx +++ b/src/pages/Oauth/AuthForm/EmailLoginForm.tsx @@ -40,6 +40,11 @@ const EmailLoginForm = ({ flowStatus }: { flowStatus: FlowStatus }) => { console.debug('resp loginEmail', resp) } + const qs = useParsedQueryString<{ flow: string }>() + const onSendCode = async ({ email }: { email: string }) => { + return KyberOauth2.oauthUi.sendVerifyCode({ email, flow: qs.flow + '' }) + } + return ( { style={{ width: 340, height: 36 }} onDismissVerifyModal={onDismissVerifyModal} isShowVerify={isShowVerify} - sendCode={KyberOauth2.oauthUi.sendVerifyCode} + sendCode={onSendCode} verifyCode={onVerifyCode} /> diff --git a/yarn.lock b/yarn.lock index 7417c9cc99..ec3f0b9fed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2257,10 +2257,10 @@ bs58 "^5.0.0" uuid "^8.3.2" -"@kybernetwork/oauth2@1.0.1-rc.3": - version "1.0.1-rc.3" - resolved "https://npm.pkg.github.com/download/@kybernetwork/oauth2/1.0.1-rc.3/203f2fdca94c06938ab606111b90f7b15e6e8cef#203f2fdca94c06938ab606111b90f7b15e6e8cef" - integrity sha512-HJufZhA/wPeF5d/8/swXh9Pd/E7OzJ1iQpOysaJ8WUIUUgAxYb54j2cVX5COAd76r5EctD0ge4ekhOSRDcNVAg== +"@kybernetwork/oauth2@1.0.1-rc.4": + version "1.0.1-rc.4" + resolved "https://npm.pkg.github.com/download/@kybernetwork/oauth2/1.0.1-rc.4/954d9fd7699ac79bcce1a91a5159e451b98d3ed9#954d9fd7699ac79bcce1a91a5159e451b98d3ed9" + integrity sha512-word23WbqARrHIAR/JStAvSdmupQZC07k8xCU2VidRjeT2nhLxvi+4j/FLBKwzLvgObvBHnqDCqbr9D434qjXQ== dependencies: axios "1.2.1" client-oauth2 "^4.3.3"