fix(settings): accept team invite codes in the Settings license field#1836
Merged
Conversation
…t the activation sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) calledactivate(licenseKey:)directly, so the invite code was sent to/activateand 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 toactivate(licenseKey:)oractivate(inviteCode:). Both entry points (the Settings pane and the sheet) now call it, so they behave identically.isLicenseKeymoved toLicenseManageras the single source of truth (nonisolated, it is a pure regex check).Tests
Existing
isLicenseKeytests updated toLicenseManager.isLicenseKeyand 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).