first-of.ts
This file
Path
apps/platform/src/sessions/first-of.ts
21 lines · 479 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–21why, one step back1import { Effect, Option } from "effect";23import { Sessions } from "../sessions.ts";45export const firstOf = (6 sessions: readonly Sessions["Service"][]7): Sessions["Service"] =>8 Sessions.of({9 verify: (token) =>10 Effect.gen(function* () {11 for (const { verify } of sessions) {12 const person = yield* verify(token);1314 if (Option.isSome(person)) {15 return person;16 }17 }1819 return Option.none();20 }),21 });