Skip to content

Commit

Permalink
fix: refresh token on visit after 15 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Oct 11, 2022
1 parent caed1f4 commit d153f20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function App(

const getInitalData = async () => {
setIsLoading(true);
await authService.refreshAccessToken();
setUser(await userService.getCurrentUser());
setIsLoading(false);
};
Expand All @@ -47,7 +48,7 @@ function App(
}, []);

useEffect(() => {
setCookies("mantine-color-scheme", systemTheme, {
setCookies("color-schema", systemTheme, {
maxAge: 60 * 60 * 24 * 30,
});
setColorScheme(systemTheme);
Expand Down Expand Up @@ -90,6 +91,6 @@ export default App;

App.getInitialProps = ({ ctx }: { ctx: GetServerSidePropsContext }) => {
return {
colorScheme: getCookie("mantine-color-scheme", ctx) || "light",
colorScheme: getCookie("color-schema", ctx) || "light",
};
};

0 comments on commit d153f20

Please sign in to comment.