( userId: string, slug: string, )
| 173 | // canonicalize-onto-session-org behavior. Per-request store layers for the |
| 174 | // same reason as organizationDisplay; both stores share the one socket. |
| 175 | const authorizeLastOrgSlug = async ( |
| 176 | userId: string, |
| 177 | slug: string, |
| 178 | ): Promise<{ readonly id: string } | null> => { |
| 179 | const dbLive = makeDbLayer(); |
| 180 | const exit = await getRuntime().runPromiseExit( |
| 181 | authorizeOrganizationSelector(userId, slug).pipe( |
| 182 | Effect.provide( |
| 183 | Layer.mergeAll( |
| 184 | makeUserStoreLayer(), |
| 185 | makeMemberDirectoryLayer(), |
| 186 | makeWorkOsMirrorLayer(), |
| 187 | ).pipe(Layer.provide(dbLive)), |
| 188 | ), |
| 189 | ), |
| 190 | ); |
| 191 | return Exit.isSuccess(exit) ? exit.value : null; |
| 192 | }; |
| 193 | |
| 194 | const hintSetCookie = (hint: AuthHint) => |
| 195 | `${AUTH_HINT_COOKIE}=${encodeAuthHint(hint)}; ${HINT_COOKIE_ATTRIBUTES}; Max-Age=${AUTH_HINT_MAX_AGE_SECONDS}`; |
no test coverage detected