Repository navigation
Conversation
An account whose email was never confirmed could never be recovered. Sign in refuses an inactive user, signing up again answered "Email is already registered", password reset skipped inactive users, and there is no resend of the activation email. The account only disappeared after the cleaner walked it through the whole trial lifecycle (welcome, plan reminder, lock warning, lock, removal), at least 40 days and in practice longer because Clean() advances one user per minute. Those four emails went to an address nobody had confirmed, so anyone who typed a stranger's address had that stranger mailed for weeks. #79 kept activation tokens non-expiring precisely because re-registering was blocked and expiry would strand the user. That block is what this removes: - Activation tokens expire after cleaner.activation_token_ttl_seconds (86400 in prod, uat and local, 45 in integration so the API test can wait it out). GetActivateAction refuses an expired token. - CreateNewUser on an email held by an inactive user whose activation has expired (or who has no activation action at all) removes that account and registers afresh, sending a new activation email. An active account, or an inactive one still inside the window, still answers "already registered". - The cleaner purges expired unactivated accounts every tick with one indexed query, batched at 100, removing domains, actions and the user with no email. The query also requires registered_at to be older than the TTL, so a user inserted a moment before its activation action cannot be caught in between. - Clean() skips inactive users, so lifecycle emails only go to confirmed addresses. The sign-up path is the one the API test exercises, because the integration environment runs with the user cleaner disabled. The new key has no default and fails startup when missing, like cleaner.user. On the first prod deploy the purge removes every historical unactivated account older than a day, 100 per minute. Closes syncloud/platform#673
WebUserActivate wrapped every error from Users.Activate in a plain "invalid request", which ErrorToResponse maps to 500. An expired, unknown or already used link is the visitor's problem, not the server's, and Activate.vue already shows the message of a 400 response but sends anything else to /error. Service errors now pass through as 400 with their message, following the switch-subscription handler; anything else stays hidden behind "invalid request". The expiry message tells the visitor to register again, which since the previous commit is what frees the email. Build 1697 caught this: the API test got 500 for the expired token.
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 account that never confirmed its email was stuck for 40+ days: sign in refused, signing up again said "Email is already registered", reset skipped it, no resend. Meanwhile the cleaner sent it the welcome, plan, lock and removal emails at an unconfirmed address.
cleaner.activation_token_ttl_seconds; 45s in integration).First prod deploy will purge all historical unactivated accounts older than a day, 100 per minute.
Tests: unit tests for token expiry, sign-up restart and the purge; API test
test_user_activation_expired_signup_starts_overcovers signup → expiry → old token rejected → sign up again → activate → sign in.Closes syncloud/platform#673