This repository has no description
Something went wrong. Try again.
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0-or-later
import type {UserID} from '../BrandedTypes';import {createMfaBackupCode} from '../BrandedTypes';import type {MfaBackupCodeRow} from '../database/types/AuthTypes';
export class MfaBackupCode { readonly userId: UserID; readonly code: string; readonly consumed: boolean;
constructor(row: MfaBackupCodeRow) { this.userId = row.user_id; this.code = row.code; this.consumed = row.consumed ?? false; }
toRow(): MfaBackupCodeRow { return { user_id: this.userId, code: createMfaBackupCode(this.code), consumed: this.consumed, }; }}