• A validator that checks if user is an admin user.

    Parameters

    • authenticate: AuthenticationFunction
    • authSecrets: AuthSecrets

      Auth secrets used to validate the token.

    • adminUserService: Pick<UserDefaultAdapterAPI, "isAdminUser">
    • logger: Logger
    • context: AdapterHandlerContext

    Returns Promise<number>

    200 if user is an admin user.

    Description

    1. If the token is an app token, the validator will return 200.

    2. If the token is a user token, the validator will check if the user is an admin user.

    3. If the token is invalid, the validator will throw an error.

    Throws

    401 NBError Unauthorized

    • If the token is invalid.
    • If the token is a user token and the user is not an admin user.

Generated using TypeDoc