( organizationId: string, )
| 146 | // requests, which Cloudflare forbids. A miss or failure reads as empty strings |
| 147 | // — display-only, corrected by the client's /account/me write. |
| 148 | const organizationDisplay = async ( |
| 149 | organizationId: string, |
| 150 | ): Promise<{ name: string; slug: string }> => { |
| 151 | const exit = await getRuntime().runPromiseExit( |
| 152 | Effect.flatMap(UserStoreService.asEffect(), (users) => |
| 153 | users.use((store) => store.getOrganization(organizationId)), |
| 154 | ).pipe(Effect.provide(Layer.provide(makeUserStoreLayer(), makeDbLayer()))), |
| 155 | ); |
| 156 | return Exit.isSuccess(exit) |
| 157 | ? { name: exit.value?.name ?? "", slug: exit.value?.slug ?? "" } |
| 158 | : { name: "", slug: "" }; |
| 159 | }; |
| 160 | |
| 161 | const hintSetCookie = (hint: AuthHint) => |
| 162 | `${AUTH_HINT_COOKIE}=${encodeAuthHint(hint)}; ${HINT_COOKIE_ATTRIBUTES}; Max-Age=${AUTH_HINT_MAX_AGE_SECONDS}`; |
no test coverage detected