Skip to content

fix(settings): accept team invite codes in the Settings license field#1836

Merged
datlechin merged 1 commit into
mainfrom
fix/invite-code-settings-activation
Jul 8, 2026
Merged

fix(settings): accept team invite codes in the Settings license field#1836
datlechin merged 1 commit into
mainfrom
fix/invite-code-settings-activation

Conversation

@datlechin

Copy link
Copy Markdown
Member

An invited teammate follows the email ("Open TablePro, go to Settings, and enter this invitation code") and pastes the 48-character invite code into Settings > Account > License Key, then gets "Invalid license key format." The code never reaches the join-team endpoint.

Cause

The invite-code auto-detection lived only in the standalone LicenseActivationSheet. The Settings > Account field (LicenseSection) called activate(licenseKey:) directly, so the invite code was sent to /activate and rejected by the license-key format check (server 422 → "Invalid license key format").

Fix

Centralize the detection in LicenseManager.activate(codeOrKey:): it checks whether the input looks like a license key (XXXXX-XXXXX-XXXXX-XXXXX-XXXXX) and routes to activate(licenseKey:) or activate(inviteCode:). Both entry points (the Settings pane and the sheet) now call it, so they behave identically. isLicenseKey moved to LicenseManager as the single source of truth (nonisolated, it is a pure regex check).

Tests

Existing isLicenseKey tests updated to LicenseManager.isLicenseKey and pass (key format recognized, invite code rejected). App builds; SwiftLint clean. Folded into the existing unreleased "Join a team" CHANGELOG entry (the invite-code feature has not shipped yet).

@datlechin datlechin merged commit 4d4b7d5 into main Jul 8, 2026
2 checks passed
@datlechin datlechin deleted the fix/invite-code-settings-activation branch July 8, 2026 16:08
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