Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneeskeeb

#362 Unified login input that detects email vs username by presence of '@'

Opened by keeb · 5/16/2026· Shipped 5/16/2026

Problem

The login form currently defaults to email + password, with a separate link to switch to username + password. After signing up with a username (BetterAuth allows either), users have to remember which field type they used and click the toggle if they picked username. Password managers also struggle: 1Password saves the username the user typed, but if the saved value is an email and the form is set to username (or vice versa), prefill is either wrong or blocked.

This compounded with issue #360 (DNS domain mismatch between swamp.club and swamp-club.com) to produce a confusing first-time login experience.

Proposed Solution

Replace the email-field-plus-toggle pattern with a single identifier input. When the form is submitted, branch on whether the value contains "@":

  • contains "@" → call the email + password sign-in path
  • otherwise → call the username + password sign-in path

The input's label could simply be "Email or username". Add autocomplete=\"username\" (HTML's username autocomplete value already covers both cases for password managers) so 1Password / Bitwarden / browser-built-in managers match whatever string was saved at signup.

Alternatives

  1. Keep two fields but auto-toggle based on what the user is typing (live detection of "@"). More UI complexity, same end state.
  2. Force every account to have both an email and a username and accept either. Larger backend change; the unified-input UX win does not actually require it.
  3. Detect server-side: take one identifier and try email first, fall back to username on miss. Doubles auth attempts for the username case and could trip rate limiters; client-side branching avoids that.

Context

Surfaced during triage of issue #360 ("Account creation immediately followed by swamp auth login is confusing because of DNS switch from swamp.club to swamp-club.com"). The narrow fix that shipped in PR #540 canonicalized the install command on swamp-club.com. The form-harmonization half of #360 was explicitly deferred — this issue is that follow-up.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

5/16/2026, 6:50:00 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
keeb assigned keeb5/16/2026, 6:38:23 PM

Sign in to post a ripple.