bugfix: automatically refresh user's session (#3148)

📝 (App.tsx): Update imports and add new constants for access token expiration time
🔧 (App.tsx): Add support for refreshing access token and setting expiration time
📝 (authAdminGuard/index.tsx): Remove unnecessary logout function and add conditional check for login page
📝 (authGuard/index.tsx): Add conditional check for login page
📝 (constants.ts): Add constants for access token expiration time
📝 (authContext.tsx): Remove logout function and update related logic
📝 (api.tsx): Add conditional check for login page
📝 (use-post-logout.ts): Remove navigate function call
📝 (LoginPage/index.tsx): Add logic to reset flows and selected folder on successful login

✨ (LoginPage/index.tsx): Add support for managing folders in the login page to improve user experience
🔧 (authStore.ts): Update logout function to clear user data and redirect to login page for better security and user experience
📝 (contexts/auth.ts): Remove unnecessary logout function from AuthContextType for consistency
🔧 (vite.config.mts): Add environment variables for ACCESS_TOKEN_EXPIRE_SECONDS and CI to improve configuration flexibility

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
This commit is contained in:
Cristhian Zanforlin Lousa 2024-08-01 16:45:32 -03:00 • committed by GitHub
commit 7c75ad0728
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 84 additions and 69 deletions

View file

@ -32,6 +32,10 @@ export default defineConfig(({ mode }) => {
},
define: {
"process.env.BACKEND_URL": JSON.stringify(process.env.BACKEND_URL),
"process.env.ACCESS_TOKEN_EXPIRE_SECONDS": JSON.stringify(
process.env.ACCESS_TOKEN_EXPIRE_SECONDS,
),
"process.env.CI": JSON.stringify(process.env.CI),
},
plugins: [react(), svgr(), tsconfigPaths()],
server: {