Commit Graph

6 Commits

Author SHA1 Message Date
e1e961ebea refactor(esi_sso): simplify system ID resolution by using a local cache 2025-08-09 20:04:37 +02:00
f06a60c701 feat(esi): add PostRouteForAllByNames and resolve system names in batch
This commit introduces a new function `PostRouteForAllByNames` to the ESI service, which allows setting a complete route (including waypoints) for all logged-in characters. This is achieved by batch resolving system names to their IDs, improving efficiency and simplifying the process of setting complex routes.

The changes include:
- Adding `ResolveSystemIDsByNames` to `ESISSO` to fetch multiple system IDs in a single ESI request.
- Implementing `PostRouteForAll` in `ESISSO` to handle the logic of setting the destination and waypoints for all characters.
- Updating `App.go` to expose `PostRouteForAllByNames` for frontend use.
- Modifying the frontend component `RegionMap.tsx` to utilize the new `PostRouteForAllByNames` function when setting routes, replacing the previous sequential calls to `SetDestinationForAll` and `AddWaypointForAllByName`.
- Updating Wails generated type definitions (`.d.ts` and `.js`) to reflect the new function.
2025-08-09 20:01:59 +02:00
13da1c8340 feat(app): implement character login and destination setting for multiple characters
This commit introduces several key features:

- **Multiple Character Support**: The application can now handle multiple logged-in EVE Online characters.
- **List Characters**: A new function `ListCharacters` allows retrieving a list of all authenticated characters.
- **Set Destination for All**: The `SetDestinationForAll` function enables setting a destination for all logged-in characters simultaneously.
- **UI Updates**: The frontend has been updated to display logged-in characters and to allow setting destinations for all characters.
- **Backend Refinements**: The ESI SSO logic has been improved to support refreshing tokens for multiple characters and to handle the new multi-character functionality.
- **Dependency Updates**: Dependencies have been updated to their latest versions.

chore: update go module dependencies
2025-08-09 19:30:51 +02:00
3f9d315978 feat(esi): integrate GORM for local ESI token storage and system ID resolution 2025-08-09 19:18:09 +02:00
ca610000db feat(esi): improve ESI SSO login flow and system name resolution
This commit introduces several improvements to the ESI (EVE Server Interface) Single Sign-On (SSO) flow and system name resolution:

**ESI SSO Login Flow:**
- **Asynchronous Callback Server:** The `StartCallbackServer` function is now deprecated in favor of `StartCallbackServerAsync`. This allows the callback server to run in the background without blocking the main application thread, improving responsiveness.
- **Improved Login Status Polling:** After initiating the ESI login, the frontend now polls the `ESILoggedIn` status for a short period. This ensures that the UI reflects the login status more accurately and promptly after the user completes the authentication flow in their browser.
- **Error Handling:** Added more specific error messages for failed token exchanges and invalid SSO responses.

**System Name Resolution:**
- **Multi-stage Resolution:** The `ResolveSystemIDByName` function now employs a more robust, multi-stage approach to find system IDs:
 1. It first attempts to use the `universe/ids` endpoint for direct name-to-ID mapping, which is generally more accurate.
 2. If that fails, it falls back to a `strict` search via the `search` endpoint.
 3. As a final fallback, it performs a non-strict search and then resolves the names of the returned IDs to find an exact case-insensitive match. If no exact match is found, it returns the first result.
- **Logging:** Added more detailed logging for each stage of the system name resolution process, aiding in debugging.
- **ESI API Headers:** Ensured that necessary headers like `Accept` and `X-User-Agent` are correctly set for ESI API requests.

**Frontend Changes:**
- **Import `ESILoggedIn`:** The `ESILoggedIn` function is now imported into the `Header.tsx` component.
- **Updated Toast Message:** The toast message for setting a destination now includes the system name for better context in case of errors.
2025-08-09 19:08:05 +02:00
478a628b6f feat(app): implement EVE SSO login and waypoint setting functionality 2025-08-09 18:49:36 +02:00