Skip to content

fix: OTP error handling with auto-logout + account copy button#12

Merged
lshw54 merged 2 commits intomainfrom
fix/otp-error-handling-and-double-click-copy
Apr 21, 2026
Merged

fix: OTP error handling with auto-logout + account copy button#12
lshw54 merged 2 commits intomainfrom
fix/otp-error-handling-and-double-click-copy

Conversation

@lshw54
Copy link
Copy Markdown
Owner

@lshw54 lshw54 commented Apr 21, 2026

Problems

  1. When a session is expired or kicked (e.g. logged in from another device), clicking "Get OTP" fails silently with no error feedback. The user has no idea the session is dead.

  2. No quick way to copy a game account ID without right-click → context menu.

Changes

OTP retrieval error handling

  • OTP failure now shows an error toast instead of failing silently
  • If the error indicates session expiry (閒置過久, 重新登入, Invalid credentials, Not authenticated, expired), the session is automatically removed and the user is redirected to the login page with a "Session expired" toast
  • Added launcher.otp_error i18n key (EN / 繁中 / 简中)

Account copy button

  • Each account card now has a small copy icon in the top-right corner (visible on hover)
  • Clicking it copies the game account ID to clipboard with a brief ✓ confirmation
  • Does not affect layout or trigger error toasts

lshw54 added 2 commits April 21, 2026 15:19
When OTP retrieval fails due to session expiry or being kicked
(e.g. '閒置過久,請嘗試重新登入'), the active session is now
automatically removed and the user is redirected to the login page
with a 'Session expired' error toast.

Previously, the error was silently swallowed with no UI feedback.

Also adds launcher.otp_error i18n key for generic OTP failure messages.
Adds a small copy icon (top-right corner, visible on hover) to each
account card. Clicking it copies the game account ID to clipboard
and shows a brief checkmark confirmation.

Replaces the previous double-click-to-copy approach which used
error toasts and disrupted the layout.
@lshw54 lshw54 merged commit fd15762 into main Apr 21, 2026
3 checks passed
@lshw54 lshw54 deleted the fix/otp-error-handling-and-double-click-copy branch April 21, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant