Skip to main content

Abstract Class: BaseAuthDiscoverRouteMongo

Defined in: auth/src/routes/mongo/BaseAuthDiscoverRouteMongo.ts:8

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.

Extends​

Constructors​

Constructor​

new BaseAuthDiscoverRouteMongo(): BaseAuthDiscoverRouteMongo

Returns​

BaseAuthDiscoverRouteMongo

Inherited from​

BaseAuthDiscoverRoute.constructor

Properties​

aliasClass​

protected aliasClass: any = AliasMongo

Defined in: auth/src/routes/mongo/BaseAuthDiscoverRouteMongo.ts:9

Overrides​

BaseAuthDiscoverRoute.aliasClass


aliasRepo?​

protected optional aliasRepo?: RepoUtils<AliasMongo>

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

Inherited from​

BaseAuthDiscoverRoute.aliasRepo


messagingUtils?​

protected optional messagingUtils?: MessagingUtils

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

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

Inherited from​

BaseAuthDiscoverRoute.messagingUtils


rateLimiter?​

protected optional rateLimiter?: RateLimiter

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

Inherited from​

BaseAuthDiscoverRoute.rateLimiter


secretClass​

protected secretClass: any = SecretMongo

Defined in: auth/src/routes/mongo/BaseAuthDiscoverRouteMongo.ts:10

Overrides​

BaseAuthDiscoverRoute.secretClass


secretRepo?​

protected optional secretRepo?: RepoUtils<SecretMongo>

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

Inherited from​

BaseAuthDiscoverRoute.secretRepo


userClass​

protected userClass: any = UserMongo

Defined in: auth/src/routes/mongo/BaseAuthDiscoverRouteMongo.ts:11

Overrides​

BaseAuthDiscoverRoute.userClass


userUtils?​

protected optional userUtils?: UserUtils<UserMongo, AliasMongo>

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

Inherited from​

BaseAuthDiscoverRoute.userUtils

Methods​

convertAliasType()​

protected convertAliasType(type): OTPContactType

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

Parameters​

type​

AliasType

Returns​

OTPContactType

Inherited from​

BaseAuthDiscoverRoute.convertAliasType


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>

Inherited from​

BaseAuthDiscoverRoute.discover


initialize()​

protected initialize(): Promise<void>

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

Returns​

Promise<void>

Inherited from​

BaseAuthDiscoverRoute.initialize