( organizationId: string, )
| 149 | // requests, which Cloudflare forbids. A miss or failure reads as empty strings |
| 150 | // — display-only, corrected by the client's /account/me write. |
| 151 | const organizationDisplay = async ( |
| 152 | organizationId: string, |
| 153 | ): Promise<{ name: string; slug: string }> => { |
| 154 | const exit = await getRuntime().runPromiseExit( |
| 155 | Effect.flatMap(UserStoreService.asEffect(), (users) => |
| 156 | users.use((store) => store.getOrganization(organizationId)), |
| 157 | ).pipe(Effect.provide(Layer.provide(makeUserStoreLayer(), makeDbLayer()))), |
| 158 | ); |
| 159 | return Exit.isSuccess(exit) |
| 160 | ? { name: exit.value?.name ?? "", slug: exit.value?.slug ?? "" } |
| 161 | : { name: "", slug: "" }; |
| 162 | }; |
| 163 | |
| 164 | // Live membership check for the last-org cookie's slug. Same authorize path |
| 165 | // as any org selector — the cookie is a preference, so a slug the user can't |
no test coverage detected