{"record":{"id":"58cce10d30de13ac","repo":"yikart/AiToEarn","slug":"errhttpback-err-no-power-login","errorCode":"ErrHttpBack.err_no_power_login","errorMessage":"err_no_power_login","messagePattern":"err_no_power_login","errorType":"error_code","errorClass":"AppHttpException","httpStatus":400,"severity":"error","filePath":"project/aitoearn-electron/server/src/user/userLogin.controller.ts","lineNumber":105,"sourceCode":"    // 验证短信验证码\n    if (process.env.NODE_ENV !== 'development' && code !== 'yika888666') {\n      const res = await this.loginService.verifyPhoneCode(\n        phone,\n        code,\n        LoginTypeCacheKey.Code,\n      );\n      if (!res) throw new AppHttpException(ErrHttpBack.err_user_code_nohad);\n    }\n\n    let userInfo: User = await this.userService.getUserInfoByPhone(phone);\n    if (!userInfo) {\n      const newUser = new NewUserByPhone(phone);\n      if (!!inviteCode) newUser.inviteCode = inviteCode;\n      userInfo = await this.userService.createUser(newUser);\n    }\n\n    if (userInfo.status === UserStatus.STOP)\n      throw new AppHttpException(ErrHttpBack.err_no_power_login);\n\n    const token = await this.authService.generateToken(userInfo);\n    const TokenInfo = await this.authService.decodeToken(token);\n\n    return {\n      token,\n      exp: TokenInfo.exp,\n      userInfo: await this.userService.getUserInfoById(TokenInfo.id),\n    };\n  }\n\n  @ApiOperation({\n    description: '手机号一键认证登录',\n    summary: '手机号一键认证登录',\n  })\n  @Public()\n  @Post('login/auth/phone')\n  async loginByPhoneAuth(","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-electron/server/src/user/userLogin.controller.ts#L87-L123","documentation":"After successful phone-code login (existing or newly created user), the controller checks userInfo.status; if it equals UserStatus.STOP (banned/disabled), err_no_power_login is thrown and no auth token is issued.","triggerScenarios":"Login attempt by a user whose account status is STOP — typically set by an admin via updateUserStatus.","commonSituations":"Banned account trying to log in; test account disabled by an admin; environment data carrying over a stopped status; user believes they registered fine but the account was later disabled.","solutions":["Contact an admin to check the account status and re-enable it via PUT :id/status","Use a different, active account","Verify you're logging into the correct environment (the banned account may be from another DB)"],"exampleFix":"// before\nawait loginApi.loginByPhoneCode(phone, code); // throws if banned\n// after\ntry {\n  await loginApi.loginByPhoneCode(phone, code);\n} catch (e) {\n  showAccountDisabledMessage(); // direct user to support/admin appeal\n}","handlingStrategy":"try-catch","validationCode":"const status = await userApi.getStatus?.();\nif (status === 'STOP') showAccountDisabledMessage(); // avoid login attempt","typeGuard":null,"tryCatchPattern":"try {\n  const { token } = await loginApi.loginByPhoneCode(phone, code);\n} catch (e) {\n  if (e.response?.message === 'err_no_power_login') {\n    showAccountDisabledMessage(); // appeal to admin/support\n  }\n}","preventionTips":["Surface a clear 'account disabled' message rather than a generic failure","Provide an appeal/contact-support path in the login UI","Admins should notify users before setting status to STOP"],"tags":["account-disabled","banned","login","authorization"],"backgroundTag":"account-disabled","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}