diff --git a/src/components/module/dashboard/main/MainPage.tsx b/src/components/module/dashboard/main/MainPage.tsx index 9600966..888a194 100644 --- a/src/components/module/dashboard/main/MainPage.tsx +++ b/src/components/module/dashboard/main/MainPage.tsx @@ -65,6 +65,10 @@ function ServiceRow({ chall }: ServiceRowProps) { export default function MainPage() { const { isLoading, error, data } = useUserChallenges(); + useQuery({ + queryKey: ["unlocked"], + queryFn: () => getUser("my/solves"), + }); const [flag, setFlag] = useState(""); const submitFlag = useMutation({ mutationFn: (flag: string) => diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 1678923..62aa619 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -38,7 +38,10 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) { queryCache: new QueryCache({ onError(error, query) { if (error instanceof HTTPError) { - if (error.response.status === 403) { + if ( + error.response.status === 403 || + error.response.status === 422 + ) { const jotaiStore = getDefaultStore(); jotaiStore.set(authTokenAtom, ""); }