.ts
TypeScript
(application/typescript)
// 1st-party
import { makeService } from "@ethicdevs/react-monolith";
// app
import type { AuthServiceAPI, AuthServiceDeps } from "./types";
// service methods
import { default as makeComparePasswordHashes } from "./comparePasswordHashes";
import { default as makeCreateUser } from "./createUser";
import { default as makeIsExistingUsername } from "./isExistingUsername";

export const makeAuthService = makeService<AuthServiceAPI, AuthServiceDeps>({
  comparePasswordHashes: makeComparePasswordHashes,
  createUser: makeCreateUser,
  isExistingUsername: makeIsExistingUsername,
  isExistingUserUid: () => () => undefined,
  findUserByUid: () => () => undefined,
  findUserByUsername: () => () => undefined,
  sendUserEmailAddressV8nEmail: () => () => undefined,
  validateUserEmailAddress: () => () => Promise.resolve(undefined),
});