{"record":{"id":"f49333cb9e3f358e","repo":"HeyPuter/puter","slug":"phone-verification-required","errorCode":"phone_verification_required","errorMessage":"Please verify your phone number to continue","messagePattern":"Please verify your phone number to continue","errorType":"exception","errorClass":"HttpError","httpStatus":403,"severity":"error","filePath":"src/backend/core/http/middleware/gates.ts","lineNumber":377,"sourceCode":" * gate rejects.\n */\nexport const assertVerifiedAccount = (\n    user:\n        | {\n              requires_email_confirmation?: unknown;\n              email_confirmed?: unknown;\n              requires_phone_verification?: unknown;\n              requires_card_verification?: unknown;\n          }\n        | undefined,\n): void => {\n    if (user?.requires_email_confirmation && !user?.email_confirmed) {\n        throw new HttpError(403, 'Please confirm your email to continue', {\n            legacyCode: 'email_confirmation_required',\n        });\n    }\n    if (user?.requires_phone_verification) {\n        throw new HttpError(\n            403,\n            'Please verify your phone number to continue',\n            {\n                legacyCode: 'phone_verification_required' as never,\n            },\n        );\n    }\n    if (user?.requires_card_verification) {\n        throw new HttpError(403, 'Please verify your card to continue', {\n            legacyCode: 'card_verification_required' as never,\n        });\n    }\n};\n\nexport const assertNotSuspended = (\n    user: { suspended?: unknown } | undefined,\n): void => {\n    if (user?.suspended) {","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/HeyPuter/puter/blob/908ec23eda38526170322c3edf71ba45ecb1ca95/src/backend/core/http/middleware/gates.ts#L359-L395","documentation":"Raised by `assertVerifiedAccount` when the user row has `requires_phone_verification` truthy. The account must complete phone verification before the guarded route proceeds. The `as never` cast on the legacy code signals this branch is forward-looking / not fully wired into the error-code registry yet.","triggerScenarios":"An account flagged `requires_phone_verification` calls any route guarded by `assertVerifiedAccount` before completing phone verification.","commonSituations":"A compliance/billing feature enabled phone gating for an account or region; the flag was set by an admin/automation and the user hasn't completed the flow.","solutions":["Complete the phone verification flow for the account.","As admin, clear `requires_phone_verification` if the gate is not intended.","Confirm phone verification isn't required before surfacing the gated feature to the user."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await call(); }\ncatch (e) {\n  if (e.code === 'phone_verification_required') { routeToPhoneVerification(); return; }\n  throw e;\n}","preventionTips":["Complete phone verification before exposing the gated feature.","Check that this flag is intentionally set for the account/region.","Clear the flag in admin tooling once verification completes."],"tags":["verification","phone","account","gate"],"backgroundTag":null,"analyzedSha":"908ec23eda38526170322c3edf71ba45ecb1ca95","analyzedAt":"2026-08-12T20:53:15.911Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}