MCPcopy Create free account
hub / github.com/dailydotdev/apps / oauthConsentsQueryOptions

Function oauthConsentsQueryOptions

packages/shared/src/lib/oauthApps.ts:141–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139});
140
141export const oauthConsentsQueryOptions = () => ({
142 queryKey: generateQueryKey(RequestKey.OAuthConsents),
143 queryFn: async (): Promise<OAuthConsentWithClient[]> => {
144 const consents = await getOAuthConsents();
145 return Promise.all(
146 consents.map(async (consent) => {
147 try {
148 const client = await getOAuthPublicClient(consent.clientId);
149 return { ...consent, client, isClientDisabled: false };
150 } catch (err) {
151 return {
152 ...consent,
153 client: null,
154 isClientDisabled:
155 err instanceof OAuthRequestError && err.status === 404,
156 };
157 }
158 }),
159 );
160 },
161 staleTime: StaleTime.OneMinute,
162});

Callers 6

seedFunction · 0.90
useCompanyPageReadinessFunction · 0.90
useStartupsSetupProgressFunction · 0.90
renderSetupFunction · 0.90
useOAuthConsentsFunction · 0.90
PluginPageFunction · 0.90

Calls 3

generateQueryKeyFunction · 0.90
getOAuthConsentsFunction · 0.85
getOAuthPublicClientFunction · 0.85

Tested by 1

renderSetupFunction · 0.72