basalt / auth/src / MemoryUserSource
Class: MemoryUserSource
Defined in: auth/src/stores.ts:64
Implements
Constructors
Constructor
> new MemoryUserSource(): MemoryUserSource
Returns
MemoryUserSource
Methods
create()
> create(data): Promise<AuthUser>
Defined in: auth/src/stores.ts:94
Parameters
data
email
string
passwordHash
string
Returns
Promise<AuthUser>
Implementation of
findByEmail()
> findByEmail(email): Promise<AuthUser | null>
Defined in: auth/src/stores.ts:67
Parameters
email
string
Returns
Promise<AuthUser | null>
Implementation of
findById()
> findById(id): Promise<AuthUser | null>
Defined in: auth/src/stores.ts:77
Parameters
id
string
Returns
Promise<AuthUser | null>
Implementation of
findByIds()
> findByIds(ids): Promise<PublicUser[]>
Defined in: auth/src/stores.ts:81
Bulk counterpart of UserSource.findById, for resolving the contact details of accounts the caller already knows — e.g. "email every admin of this tenant" (@basaltkit/teams' roleRecipients). Without it a caller either makes one round trip per id or reads the auth tables directly; the point of this method is that it has to do neither.
Contract:
- resolves PublicUser, never
AuthUser— a directory lookup has no business carrying a password hash, and a driver should not even SELECT the credential columns; - one entry per found id, in the order of
ids; ids with no account are omitted, so the result may be shorter than the input; - duplicate ids yield a single entry, and an empty list resolves to
[]without touching the database.
Optional: stores written before it keep compiling, and callers fall back to one findById per id.
Parameters
ids
readonly string[]
Returns
Promise<PublicUser[]>
Implementation of
update()
> update(id, patch): Promise<AuthUser | null>
Defined in: auth/src/stores.ts:100
Required for email verification and password reset. Returns the updated user.
Parameters
id
string
patch
Returns
Promise<AuthUser | null>