diff --git a/back/config/index.ts b/back/config/index.ts index 40bde347..c8c8bc80 100644 --- a/back/config/index.ts +++ b/back/config/index.ts @@ -41,7 +41,7 @@ const config: Config = { prefix: '/api', }, jwt: { - secret: process.env.JWT_SECRET || createRandomString(16, 32), + secret: process.env.JWT_SECRET || 'whyour-secret', expiresIn: process.env.JWT_EXPIRES_IN, }, cors: { diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 42dd1ad5..9e917002 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -113,6 +113,8 @@ export default function () { const responseStatus = error.response.status; if (responseStatus !== 401) { history.push('/error'); + } else { + window.location.reload(); } }) .finally(() => setInitLoading(false));