Skip to main content

Abstract Class: BaseAuthDiscoverRoute<U, A, S>

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:56

Lets an anonymous caller discover which sign-in methods (password, authenticator app, passkey, security key, one-time code) are configured for a claimed account identifier, so a sign-in UI can present only the methods that will actually work instead of a fixed list of every method the server supports.

Anti-enumeration discipline (mirrors PasskeyStrategy.challenge()'s ?uid= hint handling): a claimed identifier that doesn't resolve to any account returns the exact same EMPTY_RESULT shape as an account that resolves but has nothing configured — never a different shape, never a 404. This is a partial mitigation only (an account with methods configured is still distinguishable from one with none, same caveat PasskeyStrategy documents) — rate limiting by the claimed identifier is the other half of the mitigation.

Extended by​

Type Parameters​

U​

U extends User

A​

A extends Alias

S​

S extends Secret

Constructors​

Constructor​

new BaseAuthDiscoverRoute<U, A, S>(): BaseAuthDiscoverRoute<U, A, S>

Returns​

BaseAuthDiscoverRoute<U, A, S>

Properties​

aliasClass​

abstract protected aliasClass: any

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:57


aliasRepo?​

protected optional aliasRepo?: RepoUtils<A>

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:64


messagingUtils?​

protected optional messagingUtils?: MessagingUtils

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:71

Consulted only to learn whether WhatsApp is configured - see isWhatsAppConfigured().


rateLimiter?​

protected optional rateLimiter?: RateLimiter

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:74


secretClass​

abstract protected secretClass: any

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:58


secretRepo?​

protected optional secretRepo?: RepoUtils<S>

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:65


userClass​

abstract protected userClass: any

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:59


userUtils?​

protected optional userUtils?: UserUtils<U, A>

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:76

Methods​

convertAliasType()​

protected convertAliasType(type): OTPContactType

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:106

Parameters​

type​

AliasType

Returns​

OTPContactType


discover()​

discover(id, req): Promise<DiscoverResult>

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:129

Returns which sign-in methods are available for the given claimed identifier (a User uid or any Alias value). Always 200, always the same response shape, regardless of whether the identifier resolves to a real account.

Parameters​

id​

string | undefined

req​

HttpRequest

Returns​

Promise<DiscoverResult>


initialize()​

protected initialize(): Promise<void>

Defined in: auth/src/routes/BaseAuthDiscoverRoute.ts:79

Returns​

Promise<void>