{"record":{"id":"420a5e16fda5822d","repo":"makeplane/plane","slug":"5021","errorCode":"5021","errorMessage":"PASSWORD_TOO_WEAK","messagePattern":"PASSWORD_TOO_WEAK","errorType":"exception","errorClass":"AuthenticationException","httpStatus":null,"severity":"error","filePath":"apps/api/plane/authentication/adapter/base.py","lineNumber":95,"sourceCode":"        # validate email\n        try:\n            validate_email(email)\n        except ValidationError:\n            self.logger.warning(\"Email is not valid\")\n            raise AuthenticationException(\n                error_code=AUTHENTICATION_ERROR_CODES[\"INVALID_EMAIL\"],\n                error_message=\"INVALID_EMAIL\",\n                payload={\"email\": email},\n            )\n        # Return email\n        return email\n\n    def validate_password(self, email):\n        \"\"\"Validate password strength\"\"\"\n        results = zxcvbn(self.code)\n        if results[\"score\"] < 3:\n            self.logger.warning(\"Password is not strong enough\")\n            raise AuthenticationException(\n                error_code=AUTHENTICATION_ERROR_CODES[\"PASSWORD_TOO_WEAK\"],\n                error_message=\"PASSWORD_TOO_WEAK\",\n                payload={\"email\": email},\n            )\n        return\n\n    def __check_signup(self, email):\n        \"\"\"Check if sign up is enabled or not and raise exception if not enabled\"\"\"\n\n        # Get configuration value\n        (ENABLE_SIGNUP,) = get_configuration_value([\n            {\"key\": \"ENABLE_SIGNUP\", \"default\": os.environ.get(\"ENABLE_SIGNUP\", \"1\")}\n        ])\n\n        # Check if sign up is disabled and invite is present or not\n        if ENABLE_SIGNUP == \"0\" and not WorkspaceMemberInvite.objects.filter(email=email).exists():\n            self.logger.warning(\"Sign up is disabled and invite is not present\")\n            # Raise exception","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/authentication/adapter/base.py#L77-L113","documentation":"validate_password runs zxcvbn on self.code (the credential being validated) and requires a score >= 3 (out of 4). Below 3 is 'PASSWORD_TOO_WEAK' (code 5021). Note the parameter is named 'email' but the code checks self.code — a naming inconsistency, but the behavior is password-strength enforcement.","triggerScenarios":"Sign-up or password change where the chosen password scores 0-2 in zxcvbn: common passwords, short passwords, dictionary words, passwords closely tied to other known user fields.","commonSituations":"User picks 'password', '12345678', their email-derivable string, or a short lowercase word; zxcvbn scoring stricter than the user expects.","solutions":["Choose a longer, mixed-character, non-dictionary password (passphrase style).","Use a generated password from a password manager.","If integrating, surface code 5021 as 'Password too weak — add length/variety' and show zxcvbn feedback inline as the user types."],"exampleFix":"// before\nawait sdk.signUp({ email, password: 'password123' });\n\n// after\nawait sdk.signUp({ email, password: generatedPassphrase }); // e.g. 'correct-horse-battery-staple-9'","handlingStrategy":"validation","validationCode":"// client-side strength check mirroring zxcvbn >= 3\nimport { zxcvbn } from '@zxcvbn-ts/core';\nif (zxcvbn(password).score < 3) { setError('Password too weak'); return; }","typeGuard":"function isStrongEnough(pw: string): boolean { return zxcvbn(pw).score >= 3; }","tryCatchPattern":"try:\n    adapter.validate_password(password)\nexcept AuthenticationException as e:\n    if e.error_code == 5021:\n        return bad_request('Choose a stronger password')\n    raise","preventionTips":["Show live zxcvbn feedback as the user types","Recommend passphrases from a password manager","Don't reuse email-derived strings as passwords"],"tags":["auth","password","security","zxcvbn","authentication-adapter"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}