From 38466f3ce5a4610ce7af0686e6c4c0c1b61f5849 Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 19 Jun 2024 14:31:19 +0700 Subject: [PATCH 01/15] Fix ethereum --- package.json | 2 +- src/SSOConfig/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4d8560f..ddc48cd 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "socket.io-client": "^4.7.2", "viem": "^1.0.0", "bowser": "^2.11.0", - "wagmi": "^1.4.13", + "wagmi": "^1.3.2", "yup": "^1.3.2" }, "tsup": { diff --git a/src/SSOConfig/index.tsx b/src/SSOConfig/index.tsx index 27fbe26..3f1c8d1 100644 --- a/src/SSOConfig/index.tsx +++ b/src/SSOConfig/index.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { Col, Row } from 'react-bootstrap'; import Concordium from './Concordium'; import { useUserContext, UserContextProvider } from '../SSOButton/Providers/user'; -import MetaMask from './MetaMask'; import { useGlobalContext, GlobalContextProvider } from '../SSOButton/Providers/global'; import { connectWallet, removeWallet } from '../utils/index'; import DeleteModal from './DeleteModal'; @@ -13,6 +12,7 @@ import Social from './Social'; import Web3ContextProvider from '../SSOButton/Providers/web3'; import { Spinner } from '../components/Spinner'; import { notify } from '../components/Toast'; +const MetaMask = React.lazy(() => import('./MetaMask')); const SSO = () => { return ( From f85b25058bead0086f846b725dcd769394e1e988 Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Mon, 1 Jul 2024 14:20:54 +0700 Subject: [PATCH 02/15] fix note --- src/SSOButton/Providers/CreateAccount/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index f15bbd1..36c6e62 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -595,7 +595,7 @@ const CreateAccount = ({ ); })} -

Disclaimer : The ID @Username is public

+

The ID @Username is public and helps anonymize and pseudonymize data to protect your privacy.

From bd403835abe01bc76dd7d50949648a08d61ecac2 Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Mon, 1 Jul 2024 14:28:27 +0700 Subject: [PATCH 03/15] fix text --- src/SSOButton/Providers/CreateAccount/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index 36c6e62..a42e0e8 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -595,7 +595,7 @@ const CreateAccount = ({ ); })} -

The ID @Username is public and helps anonymize and pseudonymize data to protect your privacy.

+

Disclaimer: The ID @Username is public and helps anonymize and pseudonymize data to protect your privacy.

From 01498cca5f4f219984662d40e7545218b6240a3c Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Mon, 1 Jul 2024 14:42:44 +0700 Subject: [PATCH 04/15] fix prettier --- src/SSOButton/Providers/CreateAccount/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index a42e0e8..2364e04 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -595,7 +595,10 @@ const CreateAccount = ({ ); })} -

Disclaimer: The ID @Username is public and helps anonymize and pseudonymize data to protect your privacy.

+

+ Disclaimer: The ID @Username is public and helps anonymize and pseudonymize data to + protect your privacy. +

From 44abc3f5f35f91d09964fe6c7b682fe67cf3344e Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 3 Jul 2024 11:03:05 +0700 Subject: [PATCH 05/15] Statement params --- src/SSOButton/Providers/Concordium/sign.tsx | 2 +- src/utils/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SSOButton/Providers/Concordium/sign.tsx b/src/SSOButton/Providers/Concordium/sign.tsx index e309378..09d9e43 100644 --- a/src/SSOButton/Providers/Concordium/sign.tsx +++ b/src/SSOButton/Providers/Concordium/sign.tsx @@ -108,7 +108,7 @@ const SignMessageConcordium = ({ setLoading(true); try { const challenge = await getChallenge(account ?? ''); - const statement = await getStatement(); + const statement = await getStatement(account ?? ''); const provider: any = await detectConcordiumProvider(); const client = new ConcordiumGRPCClient(provider.grpcTransport); const accountAddr = AccountAddress.fromBase58(account); diff --git a/src/utils/index.tsx b/src/utils/index.tsx index 2502fb7..e6c3516 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -191,10 +191,10 @@ const getChallenge = async (walletAccount: string) => { } }; -const getStatement = async () => { +const getStatement = async (walletAccount: string) => { const { web3Endpoint } = getClientApp(); try { - return (await axios.get(`${web3Endpoint}/statement`)).data; + return (await axios.get(`${web3Endpoint}/statement?account=${walletAccount}`)).data; } catch (error: any) { console.log('getChallenge', error); throw error; From e250969b9e69412fb0e1c86891e87651bc470c52 Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 3 Jul 2024 11:20:11 +0700 Subject: [PATCH 06/15] Update statment --- .../Providers/CreateAccount/index.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index 2364e04..cd0fa2f 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -290,19 +290,19 @@ const CreateAccount = ({ username: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType)?.length - ? `${socialType?.id}` - : `${walletState?.accountAddress}`, + ? `${socialType?.id}` + : `${walletState?.accountAddress}`, password: passwordGenerate, email: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType)?.length - ? `${socialType?.id}@aesirx.io` - : `${walletState?.accountAddress}@aesirx.io`, + ? `${socialType?.id}@aesirx.io` + : `${walletState?.accountAddress}@aesirx.io`, organisation: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType)?.length - ? `${socialType?.id}` - : `${walletState?.accountAddress}`, + ? `${socialType?.id}` + : `${walletState?.accountAddress}`, block: 0, ...(walletState?.wallet === 'concordium' ? { wallet_concordium: walletState?.accountAddress } @@ -335,8 +335,8 @@ const CreateAccount = ({ [`field${registerForm.email}_1[email]`]: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType).length - ? `${socialType?.id}@aesirx.io` - : `${walletState?.accountAddress}@aesirx.io`, + ? `${socialType?.id}@aesirx.io` + : `${walletState?.accountAddress}@aesirx.io`, [`field${registerForm.organization}_1`]: data[`field${registerForm.organization}_1`], [`field${registerForm.message}_1`]: data[`field${registerForm.message}_1`], [`field${registerForm.order_id}_1`]: data[`field${registerForm.order_id}_1`] ?? '', @@ -420,7 +420,7 @@ const CreateAccount = ({ const handleProof = async () => { try { const challenge = await getChallenge(walletState?.accountAddress ?? ''); - const statement = await getStatement(); + const statement = await getStatement(walletState?.accountAddress ?? ''); const provider: any = await detectConcordiumProvider(); const client = new ConcordiumGRPCClient(provider.grpcTransport); const accountAddr = AccountAddress.fromBase58(walletState?.accountAddress); From 2feca428befea63c6c70298e1fd491d9a598a9f4 Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 3 Jul 2024 14:26:47 +0700 Subject: [PATCH 07/15] Update statement --- src/SSOButton/Providers/Concordium/sign.tsx | 15 +++++++++++---- src/SSOButton/Providers/CreateAccount/index.tsx | 11 +++++++++-- src/utils/index.tsx | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/SSOButton/Providers/Concordium/sign.tsx b/src/SSOButton/Providers/Concordium/sign.tsx index 09d9e43..b7819ef 100644 --- a/src/SSOButton/Providers/Concordium/sign.tsx +++ b/src/SSOButton/Providers/Concordium/sign.tsx @@ -108,7 +108,7 @@ const SignMessageConcordium = ({ setLoading(true); try { const challenge = await getChallenge(account ?? ''); - const statement = await getStatement(account ?? ''); + const statement = await getStatement(); const provider: any = await detectConcordiumProvider(); const client = new ConcordiumGRPCClient(provider.grpcTransport); const accountAddr = AccountAddress.fromBase58(account); @@ -116,8 +116,15 @@ const SignMessageConcordium = ({ const nationality: string = accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes ?.nationality; + const countryOfResidence: string = + accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes + ?.countryOfResidence; if (!nationality) { - statement[0].attributeTag = 'countryOfResidence'; + if (countryOfResidence) { + statement[0].attributeTag = 'countryOfResidence'; + } else { + statement[0].attributeTag = 'idDocIssuer'; + } } const proof = await provider.requestIdProof(account ?? '', statement, challenge); const re = await verifyProof(challenge, proof); @@ -188,8 +195,8 @@ const SignMessageConcordium = ({ {status === 'sign' ? 'Please sign message on the wallet' : status === 'loading' - ? 'Connecting...' - : `Please wait to connect...`} + ? 'Connecting...' + : `Please wait to connect...`} ) : !isExist || isSignUpForm ? ( diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index cd0fa2f..106cb45 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -420,7 +420,7 @@ const CreateAccount = ({ const handleProof = async () => { try { const challenge = await getChallenge(walletState?.accountAddress ?? ''); - const statement = await getStatement(walletState?.accountAddress ?? ''); + const statement = await getStatement(); const provider: any = await detectConcordiumProvider(); const client = new ConcordiumGRPCClient(provider.grpcTransport); const accountAddr = AccountAddress.fromBase58(walletState?.accountAddress); @@ -428,8 +428,15 @@ const CreateAccount = ({ const nationality: string = accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes ?.nationality; + const countryOfResidence: string = + accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes + ?.countryOfResidence; if (!nationality) { - statement[0].attributeTag = 'countryOfResidence'; + if (countryOfResidence) { + statement[0].attributeTag = 'countryOfResidence'; + } else { + statement[0].attributeTag = 'idDocIssuer'; + } } const proof = await provider.requestIdProof( walletState?.accountAddress ?? '', diff --git a/src/utils/index.tsx b/src/utils/index.tsx index e6c3516..2502fb7 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -191,10 +191,10 @@ const getChallenge = async (walletAccount: string) => { } }; -const getStatement = async (walletAccount: string) => { +const getStatement = async () => { const { web3Endpoint } = getClientApp(); try { - return (await axios.get(`${web3Endpoint}/statement?account=${walletAccount}`)).data; + return (await axios.get(`${web3Endpoint}/statement`)).data; } catch (error: any) { console.log('getChallenge', error); throw error; From 7dcc94a9aea3d8f51dae4cd7f19d7b7bd3ebba4c Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 3 Jul 2024 14:47:37 +0700 Subject: [PATCH 08/15] Fix prettier --- src/SSOButton/Providers/Concordium/sign.tsx | 4 ++-- src/SSOButton/Providers/CreateAccount/index.tsx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/SSOButton/Providers/Concordium/sign.tsx b/src/SSOButton/Providers/Concordium/sign.tsx index b7819ef..e85300d 100644 --- a/src/SSOButton/Providers/Concordium/sign.tsx +++ b/src/SSOButton/Providers/Concordium/sign.tsx @@ -195,8 +195,8 @@ const SignMessageConcordium = ({ {status === 'sign' ? 'Please sign message on the wallet' : status === 'loading' - ? 'Connecting...' - : `Please wait to connect...`} + ? 'Connecting...' + : `Please wait to connect...`} ) : !isExist || isSignUpForm ? ( diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index 106cb45..f637ba4 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -290,19 +290,19 @@ const CreateAccount = ({ username: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType)?.length - ? `${socialType?.id}` - : `${walletState?.accountAddress}`, + ? `${socialType?.id}` + : `${walletState?.accountAddress}`, password: passwordGenerate, email: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType)?.length - ? `${socialType?.id}@aesirx.io` - : `${walletState?.accountAddress}@aesirx.io`, + ? `${socialType?.id}@aesirx.io` + : `${walletState?.accountAddress}@aesirx.io`, organisation: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType)?.length - ? `${socialType?.id}` - : `${walletState?.accountAddress}`, + ? `${socialType?.id}` + : `${walletState?.accountAddress}`, block: 0, ...(walletState?.wallet === 'concordium' ? { wallet_concordium: walletState?.accountAddress } @@ -335,8 +335,8 @@ const CreateAccount = ({ [`field${registerForm.email}_1[email]`]: data[`field${registerForm.email}_1_email`] ? data[`field${registerForm.email}_1_email`] : Object.keys(socialType).length - ? `${socialType?.id}@aesirx.io` - : `${walletState?.accountAddress}@aesirx.io`, + ? `${socialType?.id}@aesirx.io` + : `${walletState?.accountAddress}@aesirx.io`, [`field${registerForm.organization}_1`]: data[`field${registerForm.organization}_1`], [`field${registerForm.message}_1`]: data[`field${registerForm.message}_1`], [`field${registerForm.order_id}_1`]: data[`field${registerForm.order_id}_1`] ?? '', From 30ea1fb7bbef673161d2c68d566e37769e2a6d9d Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Wed, 10 Jul 2024 14:06:31 +0700 Subject: [PATCH 09/15] add alert button --- src/SSOButton/Providers/CreateAccount/index.tsx | 14 ++++++++++++++ yarn.lock | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index f637ba4..a413a39 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -58,6 +58,11 @@ const CreateAccount = ({ isRequireEmail, hideDefaultProduct = false, isRequireConcordium = false, + alertButton = { + isShow: false, + handleClick: undefined, + alertWarning: undefined, + }, }: any) => { const [sending, setSending] = useState(false); const [captcha, setCaptcha] = useState(); @@ -695,6 +700,14 @@ const CreateAccount = ({ > {sending ? 'Sending' : 'Send inquiry'} + ) : alertButton?.isShow && alertButton?.handleClick ? ( + ) : (
)} + {alertButton?.alertWarning && alertButton?.alertWarning} )} diff --git a/yarn.lock b/yarn.lock index 5efc86e..38acbb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7044,7 +7044,7 @@ viem@^1.6.0: isows "1.0.3" ws "8.13.0" -wagmi@^1.4.13: +wagmi@^1.3.2: version "1.4.13" resolved "https://registry.yarnpkg.com/wagmi/-/wagmi-1.4.13.tgz#dc8dc077c7c2195877d7e33477b0417f5d2add4f" integrity sha512-AScVYFjqNt1wMgL99Bob7MLdhoTZ3XKiOZL5HVBdy4W1sh7QodA3gQ8IsmTuUrQ7oQaTxjiXEhwg7sWNrPBvJA== From a92d782e1ebad8129583e90fac17f89786fffca7 Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Wed, 10 Jul 2024 14:08:04 +0700 Subject: [PATCH 10/15] revert --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 38acbb5..5efc86e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7044,7 +7044,7 @@ viem@^1.6.0: isows "1.0.3" ws "8.13.0" -wagmi@^1.3.2: +wagmi@^1.4.13: version "1.4.13" resolved "https://registry.yarnpkg.com/wagmi/-/wagmi-1.4.13.tgz#dc8dc077c7c2195877d7e33477b0417f5d2add4f" integrity sha512-AScVYFjqNt1wMgL99Bob7MLdhoTZ3XKiOZL5HVBdy4W1sh7QodA3gQ8IsmTuUrQ7oQaTxjiXEhwg7sWNrPBvJA== From 4698656ed80c4addfacab02d08c5bf349d14ef68 Mon Sep 17 00:00:00 2001 From: bao Date: Fri, 12 Jul 2024 16:45:39 +0700 Subject: [PATCH 11/15] Prepare for release 1.4.12 --- package.json | 4 ++-- yarn.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 75fe78b..3755a7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aesirx-sso", - "version": "1.4.11", + "version": "1.4.12", "license": "GPL-3.0-only", "author": "AesirX", "repository": "https://github.com/aesirxio/sso", @@ -18,7 +18,7 @@ "@wagmi/core": "^1.3.8", "@web3modal/ethereum": "^2.7.0", "@web3modal/react": "^2.7.0", - "aesirx-lib": "^2.0.9", + "aesirx-lib": "^2.0.10", "axios": "^1.6.0", "bootstrap": "^5.3.0", "cross-env": "^7.0.3", diff --git a/yarn.lock b/yarn.lock index f1f05b7..cda8168 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2860,10 +2860,10 @@ aes-js@^3.1.2: resolved "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== -aesirx-lib@^2.0.9: - version "2.0.9" - resolved "https://registry.yarnpkg.com/aesirx-lib/-/aesirx-lib-2.0.9.tgz#0c081076c36454be296659675788bbed0935c1b7" - integrity sha512-tXz2K5xDIXsjOmGl1ZrDsNMMsmdf5h7vbYFSqtr7m3Shqm9zWcsUAkn9oJjTi7cLvqqiMB2kmpx9AN72PFoIbA== +aesirx-lib@^2.0.10: + version "2.0.10" + resolved "https://registry.yarnpkg.com/aesirx-lib/-/aesirx-lib-2.0.10.tgz#5bc29baa0e55726ef81b36880c6bd40c23b319fb" + integrity sha512-wQV6prcImn2shnYV+l/T+pnQk3smsR1DJhPu5XBNj5U6trqYGxxpCzAaeB4vZGhsXE1di22VSSdpSh3kcm9nkA== dependencies: axios "^1.6.0" axios-auth-refresh "^3.3.6" @@ -7044,7 +7044,7 @@ viem@^1.6.0: isows "1.0.3" ws "8.13.0" -wagmi@^1.4.13: +wagmi@^1.3.2: version "1.4.13" resolved "https://registry.yarnpkg.com/wagmi/-/wagmi-1.4.13.tgz#dc8dc077c7c2195877d7e33477b0417f5d2add4f" integrity sha512-AScVYFjqNt1wMgL99Bob7MLdhoTZ3XKiOZL5HVBdy4W1sh7QodA3gQ8IsmTuUrQ7oQaTxjiXEhwg7sWNrPBvJA== From f6231da907cb141aabc4609c095439fb8507f906 Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 17 Jul 2024 10:49:16 +0700 Subject: [PATCH 12/15] Demo account --- src/SSOButton/EmailLogin.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SSOButton/EmailLogin.tsx b/src/SSOButton/EmailLogin.tsx index 1fa86dc..b93d185 100644 --- a/src/SSOButton/EmailLogin.tsx +++ b/src/SSOButton/EmailLogin.tsx @@ -7,6 +7,8 @@ interface EmailLoginProps { spacingClass: string; noLabel: boolean; forgotPasswordLink?: string; + demoUser?: string; + demoPassword?: string; } const EmailLogin: React.FC = ({ onGetData, @@ -14,6 +16,8 @@ const EmailLogin: React.FC = ({ spacingClass, noLabel, forgotPasswordLink, + demoUser, + demoPassword, }) => { const handleOnData = (data: any) => { onGetData(data); @@ -25,8 +29,8 @@ const EmailLogin: React.FC = ({ value={{ handleOnData: handleOnData, toggle: () => {}, - demoUser: '', - demoPassword: '', + demoUser: demoUser ?? '', + demoPassword: demoPassword ?? '', noCreateAccount: false, isSignUpForm: false, isRequireEmail: false, From 30f2bd6d6373dd11487d057aa21769d6934b4316 Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Fri, 19 Jul 2024 09:52:24 +0700 Subject: [PATCH 13/15] add link socket --- src/SSOButton/Providers/CreateAccount/index.tsx | 8 ++++---- src/types.d.ts | 1 + src/utils/index.tsx | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/SSOButton/Providers/CreateAccount/index.tsx b/src/SSOButton/Providers/CreateAccount/index.tsx index a413a39..5a68077 100644 --- a/src/SSOButton/Providers/CreateAccount/index.tsx +++ b/src/SSOButton/Providers/CreateAccount/index.tsx @@ -67,7 +67,7 @@ const CreateAccount = ({ const [sending, setSending] = useState(false); const [captcha, setCaptcha] = useState(); const [loading, setLoading] = useState(''); - const { registerForm, endpoint, web3Endpoint, partnerEndpoint } = getClientApp(); + const { registerForm, endpoint, web3Endpoint, partnerEndpoint, socketEndpoint } = getClientApp(); const debouncedCheckWeb3Id: any = useCallback(debounce(validateWeb3Id, 200), []); const debouncedCheckEmail: any = useCallback(debounce(validateEmail, 200), []); const [data, setData] = useState([]); @@ -497,13 +497,13 @@ const CreateAccount = ({ formik.values[`field${registerForm.email}_1_email`] ) { const createSocketServer = async () => { - await axios.get(`${partnerEndpoint}/api/socket`); + await axios.get(`${socketEndpoint}/api/socket`); }; createSocketServer(); - if (!socket && partnerEndpoint) { - socket = io(partnerEndpoint, { + if (!socket && socketEndpoint) { + socket = io(socketEndpoint, { reconnection: true, secure: true, rejectUnauthorized: false, diff --git a/src/types.d.ts b/src/types.d.ts index 13d155b..cfe9d32 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -6,6 +6,7 @@ declare global { web3Endpoint: string; dappEndpoint: string; partnerEndpoint: string; + socketEndpoint: string; registerUsername: string; registerFirstname: string; registerLastname: string; diff --git a/src/utils/index.tsx b/src/utils/index.tsx index 2502fb7..70fdb8e 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -140,6 +140,12 @@ const getClientApp = () => { process.env.NEXT_PUBLIC_PARTNERS_URL || 'https://partners.aesirx.io'; + const socketEndpoint = window['socketEndpoint'] + ? window['socketEndpoint'] + : process.env.REACT_APP_SOCKET_URL || + process.env.NEXT_PUBLIC_SOCKET_URL || + 'https://partners.aesirx.io'; + const registerForm = { username: window['registerUsername'] ? window['registerUsername'] @@ -178,6 +184,7 @@ const getClientApp = () => { dappEndpoint, registerForm, partnerEndpoint, + socketEndpoint, }; }; From b68a4d9ce843cc20c2f51f826921c69abf39daee Mon Sep 17 00:00:00 2001 From: Gia Phu Date: Fri, 19 Jul 2024 09:55:26 +0700 Subject: [PATCH 14/15] default link --- src/utils/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/index.tsx b/src/utils/index.tsx index 70fdb8e..aade5fe 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -144,7 +144,7 @@ const getClientApp = () => { ? window['socketEndpoint'] : process.env.REACT_APP_SOCKET_URL || process.env.NEXT_PUBLIC_SOCKET_URL || - 'https://partners.aesirx.io'; + 'https://socket.aesirx.io'; const registerForm = { username: window['registerUsername'] From 596da061897baf1eed20ad5ae0728674387cb1e8 Mon Sep 17 00:00:00 2001 From: Viet Date: Fri, 19 Jul 2024 10:09:38 +0700 Subject: [PATCH 15/15] Update codeql --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 50ab584..673d0d5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,10 +34,10 @@ jobs: languages: ${{ matrix.language }} - name: Install modules - run: npm install --legacy-peer-deps + run: yarn install - name: Lint - run: npm run lint:check + run: yarn run lint:check # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below)