• Reset password handler

    Parameters

    • authAPI: Pick<AuthDefaultAdapterAPI, "checkToken">

      injected API to handle the authentication related operations

      • checkToken
    • resetPasswordSuccessConfig: PasswordEmailConfig & {
          mailService?: MailService;
          sender: string;
      }
    • userService: UserDataService

      injected service use to handle the user related operations

      • updateUser
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • body is required

    Returns Promise<adapter.AdapterHandlerResponse>

    204 Status No Content

    Description

    This handler will reset password by applying the following steps in sequence:

    1. Get token from context.headers

    2. Check token (authAPI.checkToken)

    3. Update user (userService.updateUser)

    4. Send email if enabled (resetPasswordSuccessConfig.mailService.sendMail)

    Throws

    403 NBError Forbidden

    • the token to reset password is invalid

Generated using TypeDoc