| @@ -8,7 +8,7 @@ import Typography from "@mui/material/Typography"; | |||||
| import { TFunction } from "i18next"; | import { TFunction } from "i18next"; | ||||
| import { signIn } from "next-auth/react"; | import { signIn } from "next-auth/react"; | ||||
| import { useRouter } from "next/navigation"; | import { useRouter } from "next/navigation"; | ||||
| import { useState } from "react"; | |||||
| import { useEffect, useState } from "react"; | |||||
| import { SubmitHandler, useForm } from "react-hook-form"; | import { SubmitHandler, useForm } from "react-hook-form"; | ||||
| import { useTranslation } from "react-i18next"; | import { useTranslation } from "react-i18next"; | ||||
| @@ -32,8 +32,6 @@ const getHumanFriendlyErrorMessage = ( | |||||
| }; | }; | ||||
| const LoginForm: React.FC = () => { | const LoginForm: React.FC = () => { | ||||
| // clean abilities before login | |||||
| window.localStorage.removeItem("abilities") | |||||
| const { t } = useTranslation("login"); | const { t } = useTranslation("login"); | ||||
| const { | const { | ||||
| register, | register, | ||||
| @@ -61,6 +59,11 @@ const LoginForm: React.FC = () => { | |||||
| router.push(callbackUrl); | router.push(callbackUrl); | ||||
| }; | }; | ||||
| useEffect(()=> { | |||||
| // clean abilities before login | |||||
| window.localStorage.removeItem("abilities") | |||||
| }) | |||||
| return ( | return ( | ||||
| <Stack | <Stack | ||||
| spacing={3} | spacing={3} | ||||