diff --git a/src/hooks/auth.tsx b/src/hooks/auth.tsx index 049b339..44e92ab 100644 --- a/src/hooks/auth.tsx +++ b/src/hooks/auth.tsx @@ -1,5 +1,6 @@ import Cookies from "js-cookie"; import { parseJWT } from "../api"; +import User from "../models/User"; import { useAppStore } from "../providers/AppStoreProvider"; /** Hook to interact with authentication data within the global app store. */ @@ -16,7 +17,7 @@ const useAuth = (): { * decoded version of the JWT for use elsewhere. */ const login = (jwt: string) => { - updateAppStore("auth", { jwt, user: parseJWT(jwt) }); + updateAppStore("auth", { jwt, user: parseJWT(jwt) as User }); Cookies.set("jwt", jwt, { sameSite: "strict", expires: 7, diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index 6fcac82..d2fbf27 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -43,7 +43,7 @@ const HomePage: Component = () => {