{"record":{"id":"56645f8d0007c2e9","repo":"hcengineering/platform","slug":"platform-status-socialidnotfound","errorCode":"platform.status.SocialIdNotFound","errorMessage":"SocialIdNotFound","messagePattern":"SocialIdNotFound","errorType":"exception","errorClass":"PlatformError","httpStatus":null,"severity":"info","filePath":"server/account/src/operations.ts","lineNumber":1510,"sourceCode":"  branding: Branding | null,\n  _token: string,\n  params: { email: string }\n): Promise<void> {\n  const { email } = params\n\n  if (email == null || email === '') {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.BadRequest, {}))\n  }\n\n  const normalizedEmail = cleanEmail(email)\n\n  ctx.info('Requesting password reset', { email, normalizedEmail })\n\n  const emailSocialId = await getEmailSocialId(db, normalizedEmail)\n\n  if (emailSocialId == null) {\n    ctx.error('Email social id not found', { email, normalizedEmail })\n    throw new PlatformError(\n      new Status(Severity.ERROR, platform.status.SocialIdNotFound, { value: email, type: SocialIdType.EMAIL })\n    )\n  }\n\n  const account = await getAccount(db, emailSocialId.personUuid as AccountUuid)\n\n  if (account == null) {\n    ctx.info('Account not found', { email, normalizedEmail })\n    throw new PlatformError(\n      new Status(Severity.ERROR, platform.status.AccountNotFound, { account: emailSocialId.personUuid })\n    )\n  }\n\n  const { mailURL, mailAuth } = getMailUrl()\n  const front = getFrontUrl(branding)\n\n  const token = generateToken(account.uuid, undefined, {\n    restoreEmail: normalizedEmail","sourceCodeStart":1492,"sourceCodeEnd":1528,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/server/account/src/operations.ts#L1492-L1528","documentation":"requestPasswordReset looks up the social id record for the normalized email via `getEmailSocialId`. If none exists — no account was ever registered with that email (of type EMAIL) — it throws SocialIdNotFound with the email as `value`. The server deliberately does not reveal 'no such user' differently for this flow, but the status codes do.","triggerScenarios":"Requesting a password reset for an email that has no EMAIL social id: never-registered email, account registered only via Google/GitHub (different social id type), email typo, or casing/format variant that cleanEmail did not normalize to the stored value.","commonSituations":"User tries to reset password for an OAuth-only account; user mistypes domain (gmial.com) or uses an alias not on file; account deleted earlier; email stored with different normalization (older accounts pre-normalization).","solutions":["Verify the email is spelled correctly and is the one used at signup.","If the account was created via social login, sign in with that provider instead (no local password exists to reset).","Sign up a new account if the email was never registered.","Check the socialIds collection for a record with type EMAIL and that value matches cleanEmail(email)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await requestPasswordReset(ctx, token, { email }) } catch (err) { if (isStatusError(err, platform.status.SocialIdNotFound)) show('No account with this email. Try signing up or signing in with a social provider.'); else throw err }","preventionTips":["Show 'sign in with provider' option for OAuth-only users","Validate email format client-side to catch typos","Keep email normalization (cleanEmail) consistent between signup and reset flows"],"tags":["password-reset","social-id","user-lookup"],"backgroundTag":"account-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}