-
Notifications
You must be signed in to change notification settings - Fork 63
UI/auth #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
UI/auth #1214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements authentication functionality for the Tiled web frontend, adding JWT-based authentication with session management, login/logout capabilities, and protected routes.
Key Changes
- Added authentication system with JWT token management, including automatic token refresh and session handling
- Created login page and protected route components for access control
- Integrated authentication interceptors into the Axios client for API requests
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web-frontend/vite.config.js | Added dotenv support and updated proxy configuration with security settings |
| web-frontend/src/settings.ts | Added getApiBaseUrl function and error handling for settings fetch |
| web-frontend/src/client.ts | Added auth interceptors, token refresh logic, and URL transformation utilities |
| web-frontend/src/components/tiled-app-bar/tiled-app-bar.tsx | Refactored to support authentication with login/logout buttons |
| web-frontend/src/components/tiled-app-bar/tiled-app-bar.test.tsx | Updated tests to mock auth context |
| web-frontend/src/components/protected-route.tsx | New component for protecting routes requiring authentication |
| web-frontend/src/components/login-page/login-page.tsx | New login page component with form validation |
| web-frontend/src/components/login-page/login-page.test.tsx | Tests for login page component |
| web-frontend/src/components/download-core/download-core.tsx | Added commented import for URL helper |
| web-frontend/src/auth/types.ts | New TypeScript type definitions for auth system |
| web-frontend/src/auth/token-manager.ts | New token storage and expiry management |
| web-frontend/src/auth/auth-provider.tsx | New auth context provider with state management |
| web-frontend/src/auth/auth-context.tsx | New auth context definition |
| web-frontend/src/auth/auth-api.ts | New API service for authentication endpoints |
| web-frontend/src/App.tsx | Integrated AuthProvider and updated routing structure |
| web-frontend/package.json | Added dotenv dependency |
Files not reviewed (1)
- web-frontend/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
web-frontend/src/client.ts:1
- Unnecessary try-catch block that simply re-throws the error. Remove this block and directly return the result of the operations.
import axios from "axios";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.