MCPcopy Index your code
hub / github.com/coder/coder / checkAuthorization

Function checkAuthorization

site/src/api/queries/authCheck.ts:14–31  ·  view source on GitHub ↗
(
	req: AuthorizationRequest,
	metadata?: MetadataState<TResponse & MetadataValue>,
)

Source from the content-addressed store, hash-verified

12 [AUTHORIZATION_KEY, req] as const;
13
14export function checkAuthorization<TResponse extends AuthorizationResponse>(
15 req: AuthorizationRequest,
16 metadata?: MetadataState<TResponse & MetadataValue>,
17) {
18 const base = {
19 queryKey: getAuthorizationKey(req),
20 queryFn: () => API.checkAuthorization<TResponse>(req),
21 };
22
23 if (metadata?.available) {
24 return {
25 ...base,
26 initialData: metadata.value as TResponse,
27 ...disabledRefetchOptions,
28 };
29 }
30 return base;
31}

Callers 8

WorkspaceSharingPageFunction · 0.90
WorkspaceParametersPageFunction · 0.90
AgentChatPageFunction · 0.90
TemplateLayoutFunction · 0.90
CreateWorkspacePageFunction · 0.90
TemplateSettingsLayoutFunction · 0.90
workspacePermissionsFunction · 0.90
AuthProviderFunction · 0.90

Calls 2

getAuthorizationKeyFunction · 0.85
checkAuthorizationMethod · 0.80

Tested by

no test coverage detected