MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / authorizeLastOrgSlug

Function authorizeLastOrgSlug

apps/cloud/src/auth/ssr-gate.ts:169–179  ·  view source on GitHub ↗
(
  userId: string,
  slug: string,
)

Source from the content-addressed store, hash-verified

167// bare path falls through to today's canonicalize-onto-session-org behavior.
168// Per-request store layers for the same reason as organizationDisplay.
169const 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
181const hintSetCookie = (hint: AuthHint) =>
182 `${AUTH_HINT_COOKIE}=${encodeAuthHint(hint)}; ${HINT_COOKIE_ATTRIBUTES}; Max-Age=${AUTH_HINT_MAX_AGE_SECONDS}`;

Callers 1

ssr-gate.tsFile · 0.85

Calls 4

makeUserStoreLayerFunction · 0.90
makeDbLayerFunction · 0.90
getRuntimeFunction · 0.85

Tested by

no test coverage detected