mirror of
https://github.com/NATroutter/egg-hytale.git
synced 2026-03-01 11:21:13 +03:00
[PR #11] [MERGED] Refactor authentication process to utilize refresh tokens #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/NATroutter/egg-hytale/pull/11
Author: @EliteScouter
Created: 1/13/2026
Status: ✅ Merged
Merged: 1/13/2026
Merged by: @NATroutter
Base:
main← Head:main📝 Commits (1)
2f37844Refactor authentication process to support refresh tokens and game session creation. Updated token caching to include only refresh token and profile UUID, and added functions for refreshing access tokens and creating game sessions.📊 Changes
1 file changed (+90 additions, -41 deletions)
View changed files
📝
start.sh(+90 -41)📄 Description
Problem
The previous implementation cached
session_tokenandidentity_token, which expire and cannot be reused across server restarts. This caused authentication failures when restarting the server with cached credentials.Solution
refresh_tokenandprofile_uuidinstead of session/identity tokensChanges
load_cached_tokens()- Now loads onlyrefresh_tokenandprofile_uuidsave_auth_tokens()- Now saves onlyrefresh_tokenandprofile_uuidrefresh_access_token()- Exchanges refresh token for new access tokencreate_game_session()- Creates fresh session on each startupperform_authentication()to capture refresh token from device flowMigration
Users with existing cache files will be prompted to re-authenticate once due to the format change, after which subsequent restarts will work without manual intervention.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.