Giter VIP home page Giter VIP logo

kaistian's People

Contributors

injoonh avatar

Stargazers

 avatar  avatar

Watchers

 avatar

kaistian's Issues

[Bug] `loginKaist()` function throws `ZodError` for alphanumeric student IDs

Package Scope

Package name: @kaistian/[email protected]

Describe the bug

The loginKaist() function throws a ZodError when student ID contains alphabetical characters.

Expected behavior

Expect the type to be changed to: LoginKaistSuccess.studentId: string | null.

To Reproduce

Login with an unconventional account, such as a Library account.

Possible Solution

Modify the type definition from:

ku_std_no: z.coerce.number().nullable()

to:

ku_std_no: z.string().nullable()

Additional context

For example, Library1's student ID, 'B6109', triggers this error.

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.