Skip to main content

ISession

Package: @nauth-toolkit/core Type: Interface

Entity contract for session records implemented by database packages.

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

Properties

PropertyTypeDescription
idnumberDatabase ID
userIdnumberUser database ID
accessTokenHashstringHashed access token
refreshTokenHashstringHashed refresh token
tokenFamilystringToken family for rotation tracking
deviceIdstring | nullDevice identifier
deviceNamestring | nullDevice name
deviceTypestring | nullDevice type
deviceFingerprintstring | nullDevice fingerprint
ipAddressstring | nullClient IP address
ipCountrystring | nullCountry derived from IP
ipCitystring | nullCity derived from IP
ipIspstring | nullISP derived from IP
userAgentstring | nullUser agent string
platformstring | nullPlatform (e.g., 'iOS', 'Windows')
browserstring | nullBrowser name
authMethodstring | nullAuth method (e.g., 'password', 'social')
isTrustedDevicebooleanWhether session is on a trusted device
expiresAtDateExpiration timestamp
lastActivityAtDate | nullLast activity timestamp
isRevokedbooleanWhether session has been revoked
revokedAtDate | nullRevocation timestamp
revokeReasonstring | nullReason for revocation
versionnumberToken version for rotation
metadataRecord<string, unknown> | nullCustom session metadata
createdAtDateSession creation timestamp