Skip to main content

AuthAuditEventType

Package: @nauth-toolkit/client Type: Enum

Enum of all authentication and security event types.

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

Values

Authentication Events

ValueDescription
LOGIN_SUCCESSSuccessful login
LOGIN_FAILEDFailed login attempt
LOGOUTUser logout
TOKEN_REFRESHAccess token refreshed
TOKEN_REVOKEDToken manually revoked

Registration Events

ValueDescription
SIGNUP_SUCCESSSuccessful user registration
SIGNUP_FAILEDFailed registration attempt

Verification Events

ValueDescription
EMAIL_VERIFIEDEmail verification completed
PHONE_VERIFIEDPhone verification completed
VERIFICATION_FAILEDVerification attempt failed

MFA Events

ValueDescription
MFA_ENABLEDMFA enabled for account
MFA_DISABLEDMFA disabled for account
MFA_VERIFIEDMFA verification successful
MFA_FAILEDMFA verification failed
MFA_BACKUP_CODE_USEDBackup code used for MFA

Password Events

ValueDescription
PASSWORD_CHANGEDPassword changed
PASSWORD_RESET_REQUESTEDPassword reset requested
PASSWORD_RESET_COMPLETEDPassword reset completed

Security Events

ValueDescription
ACCOUNT_LOCKEDAccount locked due to suspicious activity
ACCOUNT_UNLOCKEDAccount unlocked
SUSPICIOUS_ACTIVITYSuspicious activity detected
ADAPTIVE_MFA_TRIGGEREDAdaptive MFA triggered by risk analysis

Social Authentication Events

ValueDescription
SOCIAL_LINK_SUCCESSSocial account linked successfully
SOCIAL_LINK_FAILEDSocial account linking failed
SOCIAL_UNLINKSocial account unlinked

Examples

Filtering by Event Type:

// Get all login attempts
const logins = await client.getAuditHistory({
eventType: AuthAuditEventType.LOGIN_SUCCESS,
page: 1,
limit: 50,
});

// Get all MFA events
const mfaEvents = await client.getAuditHistory({
eventType: AuthAuditEventType.MFA_VERIFIED,
page: 1,
limit: 20,
});

Display Event Type Icons:

function getEventIcon(eventType: AuthAuditEventType): string {
const icons: Record<AuthAuditEventType, string> = {
[AuthAuditEventType.LOGIN_SUCCESS]: 'log-in',
[AuthAuditEventType.LOGIN_FAILED]: 'x-circle',
[AuthAuditEventType.LOGOUT]: 'log-out',
[AuthAuditEventType.MFA_ENABLED]: 'shield-check',
[AuthAuditEventType.MFA_VERIFIED]: 'shield',
[AuthAuditEventType.PASSWORD_CHANGED]: 'key',
[AuthAuditEventType.SUSPICIOUS_ACTIVITY]: 'alert-triangle',
// ... other mappings
};

return icons[eventType] || 'info-circle';
}

Angular Component:

export class AuditLogComponent {
eventTypes = AuthAuditEventType;
selectedType: AuthAuditEventType | null = null;

filterByType(type: AuthAuditEventType) {
this.selectedType = type;
this.loadAuditHistory(type);
}

async loadAuditHistory(type: AuthAuditEventType) {
const history = await this.authService.getClient().getAuditHistory({
eventType: type,
page: 1,
limit: 20,
});
this.events = history.data;
}
}

Used By