From 34dd491ab995e75f45183b1be8c7b3d114b5bb64 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Thu, 9 May 2024 19:08:48 +0530 Subject: [PATCH] Issue #319 feat: keycloak link added for forgot password --- src/components/Header.tsx | 2 +- src/pages/Login.tsx | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 6c4d1cf4..afe89c17 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -71,7 +71,7 @@ const Header: React.FC = () => { } }; const handleLogoutClick = () => { - router.replace('/logout'); + router.replace('/Logout'); }; const [openDrawer, setOpenDrawer] = useState(false); diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 729b53e7..f240487c 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -28,6 +28,7 @@ import { useState } from 'react'; import { useTheme } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; +import { getUserId } from '../services/ProfileService'; interface State extends SnackbarOrigin { openModal: boolean; } @@ -98,7 +99,6 @@ const LoginPage = () => { username: username, password: password, }); - console.log(response); if (response) { setTimeout(() => { setState({ @@ -115,8 +115,8 @@ const LoginPage = () => { ? localStorage.setItem('refreshToken', refreshToken) : localStorage.removeItem('refreshToken'); - // const userResponse = await getUserId(); - // localStorage.setItem('userId', userResponse?.userId); + const userResponse = await getUserId(); + localStorage.setItem('userId', userResponse?.userId); } setLoading(false); router.push('/Dashboard'); @@ -138,6 +138,7 @@ const LoginPage = () => { const handleChange = (event: SelectChangeEvent) => { setLanguage(event.target.value); i18n.changeLanguage(event.target.value); + localStorage.setItem('preferredLanguage', event.target.value); }; const handleClick = (newState: SnackbarOrigin) => () => { @@ -272,7 +273,11 @@ const LoginPage = () => { - + {t('LOGIN_PAGE.FORGOT_PASSWORD')}