Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EmailSender<Account>

Sender used in order to notify client via email about different events happened in the authentication process and account management.

Type parameters

Hierarchy

  • EmailSender

Methods

notifyAccountDisabled

  • notifyAccountDisabled(account: Account, cause: string): Promise<void>
  • Notify user that his account has been disabled.
    Usually account will be disabled because of too many failed authentication attempts or explicitly by the admin.

    Parameters

    • account: Account

      Account that has been disabled.

    • cause: string

      Explanatory message containing reason why account has been disabled.

    Returns Promise<void>

notifyAdminAboutAccountDisabling

  • notifyAdminAboutAccountDisabling(adminEmail: string, account: Account, cause: string): Promise<void>
  • Notify admin that user account has been disabled.
    Usually account will be disabled because of too many failed authentication attempts or explicitly by the admin.

    Parameters

    • adminEmail: string

      Email of the admin.

    • account: Account

      Account that has been disabled.

    • cause: string

      Explanatory message containing reason why account has been disabled.

    Returns Promise<void>

notifyMultiFactorAuthenticationFailed

  • notifyMultiFactorAuthenticationFailed(account: Account, authenticationContext: AuthenticationContext): Promise<void>
  • Notify user about failure of the multi factor authentication.
    In case attacker guesses password, it will fail at mfa. User will be notified about this, and in case it wasn't him that failed mfa, he needs to be suggested to change password.

    Parameters

    • account: Account

      Account on which failed mfa was detected.

    • authenticationContext: AuthenticationContext

      Authentication context.

    Returns Promise<void>

notifyPasswordChanged

  • Notify user that password of his account has been changed.
    In case attacker guesses his password or steals his session, user will receive this notification.
    User needs to be suggested to change password/recover account/enable mfa in case he doesn't recognize this password change attempt.

    Parameters

    • account: Account

      Account on which password has been changed.

    • changePasswordContext: ChangePasswordContext

      Change password context.

    Returns Promise<void>

sendActivateAccountToken

  • sendActivateAccountToken(account: Account, token: string): Promise<void>
  • Send account activation token to user after he registered his account.

    Parameters

    • account: Account

      Account that needs to be activated.

    • token: string

      Activate account token.

    Returns Promise<void>

sendForgotPasswordToken

  • sendForgotPasswordToken(account: Account, token: string, isEncrypted: boolean): Promise<void>
  • Send forgot password token to user after he started account recovery procedure.

    Parameters

    • account: Account

      Account that needs to be recovered.

    • token: string

      Forgot password token.

    • isEncrypted: boolean

      Whether token was encrypted with AccountModel.pubKey.

    Returns Promise<void>