This commit is contained in:
Andras Schmelczer 2026-02-14 12:53:29 +00:00
parent 3a3f899ea2
commit 128b3191e7
68 changed files with 28060 additions and 1152 deletions

View file

@ -7,13 +7,14 @@ export interface AuthUser {
verified: boolean;
}
// PocketBase RecordModel stores user fields as dynamic properties
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function recordToUser(record: any): AuthUser {
function recordToUser(record: { id: string; [key: string]: unknown }): AuthUser {
if (typeof record.email !== 'string') {
throw new Error('PocketBase record missing email field');
}
return {
id: record.id || '',
email: record.email || '',
verified: record.verified || false,
id: record.id,
email: record.email,
verified: typeof record.verified === 'boolean' ? record.verified : false,
};
}