Skip to content

basalt / auth/src / MemoryAccountLinkStore

Class: MemoryAccountLinkStore ​

Defined in: auth/src/stores.ts:146

Implements ​

Constructors ​

Constructor ​

> new MemoryAccountLinkStore(): MemoryAccountLinkStore

Returns ​

MemoryAccountLinkStore

Methods ​

create() ​

> create(link): Promise<boolean>

Defined in: auth/src/stores.ts:154

Inserts the link. MUST be atomic on (provider, subject): when a link for that pair already exists (for any user) nothing is written and false is returned — two concurrent first logins cannot both bind the subject.

Parameters ​

AccountLink

Returns ​

Promise<boolean>

Implementation of ​

AccountLinkStore.create


deleteAllForUser() ​

> deleteAllForUser(userId): Promise<void>

Defined in: auth/src/stores.ts:166

Drops every link of a user — fired when an unverified account is adopted.

Parameters ​

userId ​

string

Returns ​

Promise<void>

Implementation of ​

AccountLinkStore.deleteAllForUser


find() ​

> find(provider, subject): Promise<AccountLink | null>

Defined in: auth/src/stores.ts:149

The link for (provider, subject), or null.

Parameters ​

provider ​

string

subject ​

string

Returns ​

Promise<AccountLink | null>

Implementation of ​

AccountLinkStore.find


forUser() ​

> forUser(userId): Promise<AccountLink[]>

Defined in: auth/src/stores.ts:160

Every link of a user (any provider).

Parameters ​

userId ​

string

Returns ​

Promise<AccountLink[]>

Implementation of ​

AccountLinkStore.forUser


remove() ​

> remove(provider, subject): Promise<void>

Defined in: auth/src/stores.ts:163

Parameters ​

provider ​

string

subject ​

string

Returns ​

Promise<void>

Implementation of ​

AccountLinkStore.remove

Released under the MIT License.