• Is invitationId from me validator

    Parameters

    • authSecrets: AuthSecrets

      authentication secrets

    • authenticate: AuthenticationFunction

      injected function to handle the authentication

    • getInvitation: ((logger, invitationId) => Promise<null | Invitation>)

      injected service use to handle the invitation related operations

      • getInvitation
        • (logger, invitationId): Promise<null | Invitation>
        • Parameters

          • logger: Logger
          • invitationId: string

          Returns Promise<null | Invitation>

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query]. Note:

      • params.invitationId is required

    Returns Promise<number>

    200 Status OK

    Description

    This validator will check if invitationId is from me by applying the following steps in sequence:

    1. Get invitation by id (getInvitation)

    2. Authenticate user token (authenticate)

    3. Check if invitation is from me

    4. Return true if invitation is from me

    Throws

    400 NBError Bad Request

    • params is not found in request

    Throws

    404 NBError Not Found

    • invitation not found

    Throws

    403 NBError Forbidden

    • The invitation is not made by the user who request

Generated using TypeDoc