AuthSessionInfo.fromRecord constructor

AuthSessionInfo.fromRecord(
  1. AuthSessionRecord record, {
  2. bool isCurrent = false,
})

Creates a safe projection from record.

Copies public session metadata from record, excludes its token digest, and defaults isCurrent to false.

Implementation

factory AuthSessionInfo.fromRecord(
  AuthSessionRecord record, {
  bool isCurrent = false,
}) {
  return AuthSessionInfo(
    id: record.id,
    userId: record.userId,
    createdAt: record.createdAt,
    expiresAt: record.expiresAt,
    lastUsedAt: record.lastUsedAt,
    revokedAt: record.revokedAt,
    ipAddress: record.ipAddress,
    userAgent: record.userAgent,
    authenticationMethod: record.authenticationMethod,
    isCurrent: isCurrent,
  );
}