mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: refresh token on visit after 15 minutes
This commit is contained in:
parent
caed1f40ad
commit
d153f202e6
1 changed files with 3 additions and 2 deletions
|
@ -37,6 +37,7 @@ function App(
|
|||
|
||||
const getInitalData = async () => {
|
||||
setIsLoading(true);
|
||||
await authService.refreshAccessToken();
|
||||
setUser(await userService.getCurrentUser());
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
@ -47,7 +48,7 @@ function App(
|
|||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setCookies("mantine-color-scheme", systemTheme, {
|
||||
setCookies("color-schema", systemTheme, {
|
||||
maxAge: 60 * 60 * 24 * 30,
|
||||
});
|
||||
setColorScheme(systemTheme);
|
||||
|
@ -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",
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue