{"record":{"id":"097e58110a06661e","repo":"RocketChat/Rocket.Chat","slug":"error-user-is-not-activated","errorCode":"error-user-is-not-activated","errorMessage":"User is not activated","messagePattern":"User is not activated","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/auth/startup.js","lineNumber":439,"sourceCode":"\t\t});\n\t}\n\n\tif (login.allowed !== true) {\n\t\treturn login.allowed;\n\t}\n\n\tif (login.user.type === 'visitor') {\n\t\treturn true;\n\t}\n\n\tif (login.user.type === 'app') {\n\t\tthrow new Meteor.Error('error-app-user-is-not-allowed-to-login', 'App user is not allowed to login', {\n\t\t\tfunction: 'Accounts.validateLoginAttempt',\n\t\t});\n\t}\n\n\tif (!!login.user.active !== true) {\n\t\tthrow new Meteor.Error('error-user-is-not-activated', 'User is not activated', {\n\t\t\tfunction: 'Accounts.validateLoginAttempt',\n\t\t});\n\t}\n\n\tif (!login.user.roles || !Array.isArray(login.user.roles)) {\n\t\tthrow new Meteor.Error('error-user-has-no-roles', 'User has no roles', {\n\t\t\tfunction: 'Accounts.validateLoginAttempt',\n\t\t});\n\t}\n\n\tif (login.user.roles.includes('admin') === false && login.type === 'password' && settings.get('Accounts_EmailVerification') === true) {\n\t\tconst validEmail = login.user.emails.filter((email) => email.verified === true);\n\t\tif (validEmail.length === 0) {\n\t\t\tthrow new Meteor.Error('error-invalid-email', 'Invalid email __email__');\n\t\t}\n\t}\n\n\tlogin = await callbacks.run('onValidateLogin', login);","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/auth/startup.js#L421-L457","documentation":"validateLoginAttempt throws error-user-is-not-activated when !!login.user.active !== true, i.e. the account is inactive. Accounts become inactive when an admin deactivates them, when Accounts_ManuallyApproveNewUsers is enabled and registration is pending approval (onCreateUserAsync sets active=false with inactiveReason='pending_approval'), or when directory/OAuth sync flips the flag.","triggerScenarios":"Password or token login as a deactivated user; login immediately after self-registration on a workspace with Accounts_ManuallyApproveNewUsers enabled and before an admin approves the account.","commonSituations":"New signups stuck in the pending-approval queue nobody reviews; admin deactivation used as a soft ban; LDAP/custom-OAuth provisioning marking users inactive.","solutions":["Administration -> Users -> open the user -> set Active to true (this also approves pending_approval users)","If Accounts_ManuallyApproveNewUsers is on, review the pending users list or disable manual approval","Check directory sync / LDAP / custom OAuth callbacks that set active:false so they stop re-deactivating the account"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const user = await Users.findOneByUsername(username, { projection: { active: 1, inactiveReason: 1 } });\nif (!user?.active) {\n  throw new Error(\n    user?.inactiveReason === 'pending_approval'\n      ? 'Account pending admin approval'\n      : 'Account deactivated; ask an administrator to activate it',\n  );\n}","typeGuard":"const isActiveUser = (u: { active?: boolean } | null | undefined): u is { active: true } =>\n  u?.active === true;","tryCatchPattern":"try {\n  await loginWithPassword(user, password);\n} catch (e) {\n  if (e instanceof Meteor.Error && e.error === 'error-user-is-not-activated') {\n    // route the user to 'contact admin / pending approval' messaging; do not retry\n  }\n  throw e;\n}","preventionTips":["Review the pending-approval queue when Accounts_ManuallyApproveNewUsers is on","Audit directory-sync/OAuth callbacks that set active:false","When deactivating leavers, also invalidate their tokens to avoid confusing login failures elsewhere"],"tags":["authentication","login","user-management","account-approval"],"backgroundTag":"user-account-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}