From 790e9fb5a68a6086ece6050cc6056275c22ae9b6 Mon Sep 17 00:00:00 2001 From: AnhMTV Date: Wed, 20 Nov 2024 18:09:46 +0700 Subject: [PATCH] [Issue-149] Auto logout if login with wrong email --- .../src/contexts/AuthenticationMythProvider.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/extension-koni-ui/src/contexts/AuthenticationMythProvider.tsx b/packages/extension-koni-ui/src/contexts/AuthenticationMythProvider.tsx index 391d9dd686..db5735379a 100644 --- a/packages/extension-koni-ui/src/contexts/AuthenticationMythProvider.tsx +++ b/packages/extension-koni-ui/src/contexts/AuthenticationMythProvider.tsx @@ -92,7 +92,7 @@ export const AuthenticationMythProvider = ({ children }: AuthenticationMythProvi }); if (rs.error) { - Telegram.WebApp.showAlert(rs.error); + console.error(rs.error); } else if (rs.success) { setIsLinked(rs.success); setLinkData(rs.data); @@ -148,7 +148,9 @@ export const AuthenticationMythProvider = ({ children }: AuthenticationMythProvi setLinkData(rs.data); // Login with different email } else { - telegramConnector.showAlert(`Please login again with email "${rs.data?.link_email || ''}"`); + telegramConnector.showAlert(`Wrong email. Link Mythical account with email ${rs.data?.link_email || ''} and try again`, () => { + onLogoutMythAccount(); + }); } } else { console.log('tokenData', tokenData);