mailer.ts
This file
Path
apps/platform/src/auth/mailer.ts
19 lines · 578 bytes · TypeScript
Last changed by
Sign people in by a proven email, with a display name, and Google's emailoscabrielbefore adoption125964c
History of this fileTake it
Sign people in by a proven email, with a display name, and Google's emailoscabrielbefore adoption125964c
lines 1–19why, one step back1// The one way sign-in reaches a person outside the browser: a plain-text2// mail, from the platform's own address, with a code in it.3import { Context, Data } from "effect";4import type { Effect } from "effect";56import type { Email } from "./accounts.ts";78export interface Mail {9 readonly subject: string;10 readonly text: string;11 readonly to: Email;12}1314export class MailFailed extends Data.TaggedError("MailFailed") {}1516export class Mailer extends Context.Service<17 Mailer,18 { readonly send: (mail: Mail) => Effect.Effect<void, MailFailed> }19>()("platform/Mailer") {}