diff --git a/frontend/src/components/LoginContext.tsx b/frontend/src/components/LoginContext.tsx index 802105b..1eaeb9d 100644 --- a/frontend/src/components/LoginContext.tsx +++ b/frontend/src/components/LoginContext.tsx @@ -4,6 +4,7 @@ import {useInstance, useInstanceAxios} from "./InstanceContext"; import {useNotNullContext} from "../hooks/useNotNullContext"; import {Validity} from "@steffo/bluelib-react/dist/types"; import {useFormState} from "@steffo/bluelib-react"; +import {useStorageState} from "../hooks/useStorageState"; export interface UserData { @@ -32,7 +33,7 @@ interface LoginContextProps { export function LoginContextProvider({children}: LoginContextProps): JSX.Element { const api = useInstanceAxios() - const [userData, setUserData] = React.useState(null) + const [userData, setUserData] = useStorageState(localStorage, "userData", null) const [running, setRunning] = React.useState(false) const login = React.useCallback(