Skip to main content

AuthAuditEventType

Package: @nauth-toolkit/core Type: Enum

Complete enumeration of all authentication and security events recorded in the audit trail.

import { AuthAuditEventType } from '@nauth-toolkit/nestjs';

Login Events

ValueDescription
LOGIN_ATTEMPTLogin attempt initiated (credentials validated, risk assessed)
LOGIN_SUCCESSUser successfully authenticated
LOGIN_FAILEDLogin attempt failed (invalid credentials, account locked)
LOGIN_BLOCKEDLogin attempt blocked (account locked, IP blocked)

Session Events

ValueDescription
SESSION_CREATEDNew session created (after successful authentication)
SESSION_REVOKEDSession revoked (logout, security violation, admin action)
GLOBAL_SIGNOUTAll sessions revoked (global sign-out)

Password Events

ValueDescription
PASSWORD_CHANGEDUser changed their password
PASSWORD_RESET_REQUESTEDPassword reset requested (email/SMS sent)
PASSWORD_RESET_COMPLETEDPassword reset completed successfully
PASSWORD_FORCE_CHANGE_SETForce password change requirement set (by admin or policy)
PASSWORD_FORCE_CHANGE_COMPLETEDForce password change completed
ADMIN_PASSWORD_RESET_INITIATEDAdmin-initiated password reset started
ADMIN_PASSWORD_RESET_COMPLETEDAdmin-initiated password reset completed
ADMIN_PASSWORD_RESET_FAILEDAdmin-initiated password reset failed

Multi-Factor Authentication (MFA) Events

ValueDescription
MFA_ENABLEDMFA enabled for user account
MFA_DISABLEDMFA disabled for user account
MFA_DEVICE_ADDEDNew MFA device registered (TOTP, SMS, Passkey)
MFA_DEVICE_REMOVEDMFA device removed from account
MFA_DEVICE_UPDATEDMFA device updated (name changed, primary flag changed)
MFA_VERIFICATION_SUCCESSMFA verification succeeded
MFA_VERIFICATION_FAILEDMFA verification failed (invalid code, expired)
MFA_EXEMPTION_GRANTEDMFA exemption granted (admin action)
MFA_EXEMPTION_REVOKEDMFA exemption revoked (admin action)
MFA_BACKUP_CODES_GENERATEDBackup codes generated for MFA recovery
MFA_BACKUP_CODE_USEDBackup code used for MFA verification
MFA_PREFERRED_METHOD_UPDATEDUser's preferred MFA method updated
DEVICE_TRUSTEDDevice trusted by user (remember device feature)
DEVICE_UNTRUSTEDTrusted device revoked (user untrusted device or device expired)

Adaptive MFA Events (Risk-Based)

ValueDescription
ADAPTIVE_MFA_RISK_ASSESSEDRisk assessment completed (for future adaptive MFA implementation)
ADAPTIVE_MFA_TRIGGEREDAdaptive MFA triggered due to risk factors (for future implementation)
ADAPTIVE_MFA_BYPASSEDAdaptive MFA bypassed due to low risk (for future implementation)

Verification Events

ValueDescription
EMAIL_VERIFIEDEmail address verified successfully
EMAIL_VERIFICATION_REQUESTEDEmail verification code/link requested
EMAIL_VERIFICATION_FAILEDEmail verification failed (invalid code, expired)
PHONE_VERIFIEDPhone number verified successfully
PHONE_VERIFICATION_REQUESTEDPhone verification code requested
PHONE_VERIFICATION_FAILEDPhone verification failed (invalid code, expired)

Account Management Events

ValueDescription
ACCOUNT_CREATEDNew user account created (signup)
ACCOUNT_ACTIVATEDUser account activated
ACCOUNT_DEACTIVATEDUser account deactivated
ACCOUNT_LOCKEDUser account locked (security measure)
ACCOUNT_UNLOCKEDUser account unlocked (admin action or auto-unlock)
ACCOUNT_DISABLEDUser account disabled by admin (permanent lock)
ACCOUNT_ENABLEDUser account enabled by admin (unlock)
ACCOUNT_DELETEDUser account deleted

Profile Update Events

ValueDescription
PROFILE_UPDATEDUser profile updated (general update)
EMAIL_CHANGEDUser email address changed
PHONE_CHANGEDUser phone number changed
USERNAME_CHANGEDUser username changed
EMAIL_VERIFICATION_STATUS_UPDATEDEmail verification status manually updated (admin action)
PHONE_VERIFICATION_STATUS_UPDATEDPhone verification status manually updated (admin action)

Social Authentication Events

ValueDescription
SOCIAL_LOGINUser authenticated via social provider (Google, Apple, Facebook)
SOCIAL_ACCOUNT_LINKEDSocial account linked to user account
SOCIAL_ACCOUNT_UNLINKEDSocial account unlinked from user account

Challenge Flow Events

ValueDescription
CHALLENGE_CREATEDChallenge session created (email verification, phone verification, MFA setup)
CHALLENGE_COMPLETEDChallenge completed successfully
CHALLENGE_ATTEMPT_FAILEDChallenge attempt failed (max attempts exceeded)

Security Events

ValueDescription
SUSPICIOUS_ACTIVITYSuspicious activity detected (token reuse, impossible travel)