From 0b349ddfb2b763e781408de44d2d3b854b809b52 Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Mon, 19 Jun 2023 14:05:39 +0300 Subject: [PATCH] AnonymousForm.tsx: Disable field if user is logged in (#1448) Preventive measure against logged users supplying different email - donation remains anonymous --- .../client/one-time-donation/AnonymousForm.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/client/one-time-donation/AnonymousForm.tsx b/src/components/client/one-time-donation/AnonymousForm.tsx index fdd735ea1..a56f02dc8 100644 --- a/src/components/client/one-time-donation/AnonymousForm.tsx +++ b/src/components/client/one-time-donation/AnonymousForm.tsx @@ -2,9 +2,12 @@ import * as React from 'react' import { useTranslation } from 'next-i18next' import { Grid, Typography } from '@mui/material' import EmailField from 'components/common/form/EmailField' +import { useSession } from 'next-auth/react' export default function AnonymousForm() { const { t } = useTranslation('one-time-donation') + const { data: session } = useSession() + const isLogged = session?.accessToken ? true : false return ( <> @@ -16,7 +19,13 @@ export default function AnonymousForm() { {t('anonymous-menu.info-start')} - +