Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Missing SSO_LOGIN_PASSWORD_INCORRECT_WITHOUT_COUNT error code in loginKaist() function #9

Open
injoonH opened this issue May 2, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@injoonH
Copy link
Owner

injoonH commented May 2, 2024

Package Scope

Package name: @kaistian/[email protected]

Describe the bug

The loginKaist() function erroneously throws a ZodError when encountering an unrecognized error code SSO_LOGIN_PASSWORD_INCORRECT_WITHOUT_COUNT.

Screenshots

[
  {
    "code": "invalid_union",
    "unionErrors": [
      {
        "issues": [
          {
            "code": "invalid_type",
            "expected": "object",
            "received": "undefined",
            "path": [
              "dataMap",
              "USER_INFO"
            ],
            "message": "Required"
          },
          {
            "received": true,
            "code": "invalid_literal",
            "expected": false,
            "path": [
              "error"
            ],
            "message": "Invalid literal value, expected false"
          }
        ],
        "name": "ZodError"
      },
      {
        "issues": [
          {
            "received": "SSO_LOGIN_PASSWORD_INCORRECT_WITHOUT_COUNT",
            "code": "invalid_enum_value",
            "options": [
              "SSO_SERVER_ERROR",
              "SSO_NEED_LOGIN",
              "SSO_HTTP_CLIENT_CALL_ERROR",
              "SSO_LOGIN_PASSWORD_CHANGE_REQUIRED",
              "SSO_LOGIN_PASSWORD_INCORRECT",
              "SSO_LOGIN_PASSWORD_EXPIRED",
              "SSO_LOGIN_NOT_REGISTER",
              "SSO_LOGIN_ACCOUNT_LOCKED",
              "SSO_LOGIN_ERROR",
              "FILE_NOT_FOUND"
            ],
            "path": [
              "errorCode"
            ],
            "message": "Invalid enum value. Expected 'SSO_SERVER_ERROR' | 'SSO_NEED_LOGIN' | 'SSO_HTTP_CLIENT_CALL_ERROR' | 'SSO_LOGIN_PASSWORD_CHANGE_REQUIRED' | 'SSO_LOGIN_PASSWORD_INCORRECT' | 'SSO_LOGIN_PASSWORD_EXPIRED' | 'SSO_LOGIN_NOT_REGISTER' | 'SSO_LOGIN_ACCOUNT_LOCKED' | 'SSO_LOGIN_ERROR' | 'FILE_NOT_FOUND', received 'SSO_LOGIN_PASSWORD_INCORRECT_WITHOUT_COUNT'"
          }
        ],
        "name": "ZodError"
      }
    ],
    "path": [],
    "message": "Invalid input"
  }
]

Possible Solution

Include SSO_LOGIN_PASSWORD_INCORRECT_WITHOUT_COUNT in the enum of valid error codes for the LoginKaistError.errorCode to handle this case appropriately.

@injoonH injoonH added the bug Something isn't working label May 2, 2024
@injoonH injoonH self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant