William Nemenchainitial commit
86fb32e9/11/2022, 1:13:39 AM
.ts
TypeScript
(application/typescript)
import type { AuthServiceAPI, AuthServiceDeps } from "./types";

import { makeCompareUserPasswordHashes } from "./compareUserPasswordHashes";
import { makeIsExistingUsername } from "./makeIsExistingUsername";

export const makeAuthService: ServiceFactory<AuthServiceAPI, AuthServiceDeps> =
  (dependencies) => {
    return withDependencies<AuthServiceAPI, AuthServiceDeps>(dependencies, {
      compareUserPasswordHashes: makeCompareUserPasswordHashes,
      isExistingUsername: makeIsExistingUsername,
      isExistingUserUid: () => () => undefined,
      findUserByUid: () => () => undefined,
      findUserByUsername: () => () => undefined,
      sendUserEmailAddressV8nEmail: () => () => undefined,
      validateUserEmailAddress: () => () => undefined,
    });
  };