MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / authenticateOAuthRequest

Function authenticateOAuthRequest

packages/server/src/lib/auth.ts:16–31  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

14});
15
16export async function authenticateOAuthRequest(request: Request) {
17 const requestState = await clerkClient.authenticateRequest(request, {
18 acceptsToken: "oauth_token",
19 });
20
21 if (!requestState.isAuthenticated) {
22 return null;
23 }
24
25 const auth = requestState.toAuth();
26 if (auth.tokenType !== "oauth_token" || !auth.userId) {
27 return null;
28 }
29
30 return { userId: auth.userId };
31};

Callers 1

require-auth.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected