Foodtruck Order — TypeScript Reference - v0.1.0
    Preparing search index...

    Application use cases for safe provisioning and password authentication.

    Index
    • Authenticate an email/password credential pair.

      The lookup uses the same normalization as provisioning, and an unknown account is still verified against a dummy hash so the response time does not reveal whether the address exists.

      Parameters

      • email: string

        Candidate login address; normalized before lookup.

      • password: string

        Candidate plaintext password.

      Returns Promise<AuthenticatedUser | null>

      The PublicUser for an enabled account whose password matched, otherwise null; the reason for a failure is deliberately not distinguished.

    • Verify the current credential, then atomically change it and revoke all sessions.

      Parameters

      • userId: string
      • currentPassword: string
      • newPassword: string

      Returns Promise<void>

    • Resolve the currently authenticated account for a session.

      Parameters

      • userId: string

        Identifier stored in the authenticated session.

      • OptionalcredentialVersion: number

      Returns Promise<PublicUser | null>

      The PublicUser when the account exists and is enabled, otherwise null (a disabled or deleted account ends the session).