identities.ts
This file
Path
apps/platform/src/auth/identities.ts
26 lines · 781 bytes · TypeScript
Last changed by
Merge build/comments-platform into mainoscabrielbefore adoptionddf09e8
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–14why, one step back1import type { Handle } from "@repo/protocol/ids";2import { Context, Data } from "effect";3import type { Effect, Option } from "effect";45export type IdentityProvider = "google";67export class IdentityTaken extends Data.TaggedError("IdentityTaken")<{8 readonly provider: IdentityProvider;9 readonly subject: string;10}> {}1112export class Identities extends Context.Service<13 Identities,14 {Merge build/comments-platform into mainoscabrielbefore adoptionddf09e8
line 15why, one step back15 // The handle's key, lowercased: show the account's own handle, never this one.Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 16–26why, one step back16 readonly handleOf: (17 provider: IdentityProvider,18 subject: string19 ) => Effect.Effect<Option.Option<Handle>>;20 readonly link: (21 provider: IdentityProvider,22 subject: string,23 handle: Handle24 ) => Effect.Effect<void, IdentityTaken>;25 }26>()("platform/Identities") {}