• Activate user handler

    Parameters

    • userService: UserDataService

      Injected service used to handle the user-related operations.

    • activateUserEmailConfig: ActivateUserEmailConfig & {
          mailService?: MailService;
          sender: string;
      }

      Configuration for (re)activation email.

    • __namedParameters: {
          authSecrets: AuthSecrets;
          authenticate: AuthenticationFunction;
      }
      • authSecrets: AuthSecrets
      • authenticate: AuthenticationFunction
    • logger: Logger

      Injected logger for logging.

    • context: AdapterHandlerContext

      Request context containing headers, body, params, and query. body.userId is required.

    Returns Promise<adapter.AdapterHandlerResponse>

    204 Status No Content

    Description

    This handler will unlock the user by applying the following steps in sequence:

    1. Verify the user exists (userService.getUserById).
    2. Unlock the user (userService.updateUser).

    Throws

    Error - When userId is not defined.

    Throws

    Error - When activateUserEmailConfig is not defined.

    Throws

    Error - When no mail service is provided in the configuration.

    Throws

    Error - When the user has no email.

    Throws

    Error - When failed to send the activation email.

Generated using TypeDoc