clearKey on verify page if server send keyAttributes

This commit is contained in:
Abhinav-grd 2021-05-23 20:56:37 +05:30
parent 99976dcb05
commit 2d7c9fa5a4

View file

@ -18,6 +18,7 @@ import {
} from 'services/userService'; } from 'services/userService';
import { setIsFirstLogin } from 'utils/storage'; import { setIsFirstLogin } from 'utils/storage';
import SubmitButton from 'components/SubmitButton'; import SubmitButton from 'components/SubmitButton';
import { clearKeys } from 'utils/storage/sessionStorage';
const Image = styled.img` const Image = styled.img`
width: 350px; width: 350px;
@ -74,6 +75,7 @@ export default function Verify() {
clearFiles(); clearFiles();
setIsFirstLogin(true); setIsFirstLogin(true);
if (resp.data.keyAttributes?.encryptedKey) { if (resp.data.keyAttributes?.encryptedKey) {
clearKeys();
router.push('/credentials'); router.push('/credentials');
} else { } else {
router.push('/generate'); router.push('/generate');