( userId: string, slug: string, )
| 167 | // bare path falls through to today's canonicalize-onto-session-org behavior. |
| 168 | // Per-request store layers for the same reason as organizationDisplay. |
| 169 | const authorizeLastOrgSlug = async ( |
| 170 | userId: string, |
| 171 | slug: string, |
| 172 | ): Promise<{ readonly id: string } | null> => { |
| 173 | const exit = await getRuntime().runPromiseExit( |
| 174 | authorizeOrganizationSelector(userId, slug).pipe( |
| 175 | Effect.provide(Layer.provide(makeUserStoreLayer(), makeDbLayer())), |
| 176 | ), |
| 177 | ); |
| 178 | return Exit.isSuccess(exit) ? exit.value : null; |
| 179 | }; |
| 180 | |
| 181 | const hintSetCookie = (hint: AuthHint) => |
| 182 | `${AUTH_HINT_COOKIE}=${encodeAuthHint(hint)}; ${HINT_COOKIE_ATTRIBUTES}; Max-Age=${AUTH_HINT_MAX_AGE_SECONDS}`; |
no test coverage detected