Skip to content

Add player auth migrate account API#188

Merged
tudddorrr merged 1 commit intodevelopfrom
migrate-account-api
Mar 22, 2026
Merged

Add player auth migrate account API#188
tudddorrr merged 1 commit intodevelopfrom
migrate-account-api

Conversation

@tudddorrr
Copy link
Copy Markdown
Contributor

No description provided.

@tudddorrr tudddorrr added the enhancement New feature or request label Mar 22, 2026
@claude
Copy link
Copy Markdown

claude bot commented Mar 22, 2026

PR Review: Add player auth migrate account API

Overall structure is clean and follows existing patterns well.


Potential Bugs or Issues

Session state is cleared but never restored after migration

In SessionManager.HandleAccountMigrated, ClearSession(false) deletes TaloSessionToken from PlayerPrefs, but the migration response only returns an alias — no sessionToken or socketToken. As a result:

  1. On the next app launch, CheckForSession() returns falseOnSessionNotFound fires → the player must log in again even though migration succeeded.
  2. TaloSessionIdentifier in PlayerPrefs is never updated or cleared — it retains the old identifier, leaving stale data.
  3. InvokeIdentifiedEvent() fires immediately after (signalling the player is identified), but the identified state is not persisted.

Contrast with HandleSessionCreated, which saves both sessionToken and updates TaloSessionIdentifier via SaveSession().

If the intent is that the existing session remains valid after migration (just with a new alias), then ClearSession should not be called — only SetNewAlias + SetIdentifierPlayerPref are needed, matching the pattern in HandleIdentifierUpdated.

If the intent is to require a fresh login after migration, then InvokeIdentifiedEvent() should not be called, and CurrentAlias should not be set.

If the backend does invalidate the old session on migration, the response should include a sessionToken (and socketToken) so the new session can be persisted.


Code Quality, Performance, Security, Backwards Compatibility

No issues found.

@tudddorrr tudddorrr force-pushed the migrate-account-api branch from f722389 to 333c171 Compare March 22, 2026 12:21
@tudddorrr tudddorrr merged commit 2585a85 into develop Mar 22, 2026
2 checks passed
@tudddorrr tudddorrr deleted the migrate-account-api branch March 22, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant