mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-17 12:43:13 +02:00
fix: refresh token on visit after 15 minutes
This commit is contained in:
@@ -37,6 +37,7 @@ function App(
|
|||||||
|
|
||||||
const getInitalData = async () => {
|
const getInitalData = async () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
await authService.refreshAccessToken();
|
||||||
setUser(await userService.getCurrentUser());
|
setUser(await userService.getCurrentUser());
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
};
|
};
|
||||||
@@ -47,7 +48,7 @@ function App(
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCookies("mantine-color-scheme", systemTheme, {
|
setCookies("color-schema", systemTheme, {
|
||||||
maxAge: 60 * 60 * 24 * 30,
|
maxAge: 60 * 60 * 24 * 30,
|
||||||
});
|
});
|
||||||
setColorScheme(systemTheme);
|
setColorScheme(systemTheme);
|
||||||
@@ -90,6 +91,6 @@ export default App;
|
|||||||
|
|
||||||
App.getInitialProps = ({ ctx }: { ctx: GetServerSidePropsContext }) => {
|
App.getInitialProps = ({ ctx }: { ctx: GetServerSidePropsContext }) => {
|
||||||
return {
|
return {
|
||||||
colorScheme: getCookie("mantine-color-scheme", ctx) || "light",
|
colorScheme: getCookie("color-schema", ctx) || "light",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user