{"record":{"id":"10678543dde26e04","repo":"makeplane/plane","slug":"5092","errorCode":"5092","errorMessage":"INVALID_MAGIC_CODE_SIGN_UP","messagePattern":"INVALID_MAGIC_CODE_SIGN_UP","errorType":"exception","errorClass":"AuthenticationException","httpStatus":null,"severity":"warning","filePath":"apps/api/plane/authentication/provider/credentials/magic_code.py","lineNumber":193,"sourceCode":"                        raise AuthenticationException(\n                            error_code=AUTHENTICATION_ERROR_CODES[\"EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN\"],\n                            error_message=\"EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_IN\",\n                            payload={\"email\": str(email)},\n                        )\n                    raise AuthenticationException(\n                        error_code=AUTHENTICATION_ERROR_CODES[\"EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP\"],\n                        error_message=\"EMAIL_CODE_ATTEMPT_EXHAUSTED_SIGN_UP\",\n                        payload={\"email\": str(email)},\n                    )\n\n                if user_exists:\n                    raise AuthenticationException(\n                        error_code=AUTHENTICATION_ERROR_CODES[\"INVALID_MAGIC_CODE_SIGN_IN\"],\n                        error_message=\"INVALID_MAGIC_CODE_SIGN_IN\",\n                        payload={\"email\": str(email)},\n                    )\n                else:\n                    raise AuthenticationException(\n                        error_code=AUTHENTICATION_ERROR_CODES[\"INVALID_MAGIC_CODE_SIGN_UP\"],\n                        error_message=\"INVALID_MAGIC_CODE_SIGN_UP\",\n                        payload={\"email\": str(email)},\n                    )\n        else:\n            email = str(self.key).replace(\"magic_\", \"\", 1)\n            if User.objects.filter(email=email).exists():\n                raise AuthenticationException(\n                    error_code=AUTHENTICATION_ERROR_CODES[\"EXPIRED_MAGIC_CODE_SIGN_IN\"],\n                    error_message=\"EXPIRED_MAGIC_CODE_SIGN_IN\",\n                    payload={\"email\": str(email)},\n                )\n            else:\n                raise AuthenticationException(\n                    error_code=AUTHENTICATION_ERROR_CODES[\"EXPIRED_MAGIC_CODE_SIGN_UP\"],\n                    error_message=\"EXPIRED_MAGIC_CODE_SIGN_UP\",\n                    payload={\"email\": str(email)},\n                )","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/authentication/provider/credentials/magic_code.py#L175-L211","documentation":"Raised in MagicCodeProvider.set_user_data (magic_code.py:193) — the SIGN_UP counterpart of 55. Wrong code on verify, attempts not exhausted, and NO User exists for the email. Code 5092, payload {email}. Token remains valid for further attempts.","triggerScenarios":"A valid token exists but the submitted code does not match; the verify counter is under the cap; the email is unregistered. AuthenticationException code 5092 is raised with the cleaned email.","commonSituations":"Signup with a mistyped code, stale code from a previous signup attempt, or an attacker guessing codes for an unknown email.","solutions":["Resubmit the correct 6-digit code from the latest email.","Confirm the email used for signup is the one receiving the code.","Regenerate a new code if the current one is ambiguous, but remember each regenerate counts toward the issue limit."],"exampleFix":"// before: wrong code, unregistered email -> 5092\n// after: enter the exact 6 digits from the newest signup email","handlingStrategy":"try-catch","validationCode":"from plane.authentication.provider.credentials.magic_code import MagicCodeProvider\nfrom plane.settings.redis import redis_instance\n\ndef verify_budget_remaining(token_key: str) -> int:\n    ri = redis_instance()\n    raw = ri.get(MagicCodeProvider._verify_attempts_key(token_key))\n    used = int(raw) if raw else 0\n    return max(MagicCodeProvider.MAX_VERIFY_ATTEMPTS - used, 0)","typeGuard":null,"tryCatchPattern":"try:\n    provider.set_user_data()\nexcept AuthenticationException as e:\n    if e.error_code == 5092:\n        show_remaining_attempts_and_re_prompt(email=e.payload.get('email'))\n    else:\n        raise","preventionTips":["Use only the latest code for the email being signed up.","Track remaining attempts to avoid hitting the exhaustion cap (5102)."],"tags":["authentication","magic-code","invalid-code","signup"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}