MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / getProfileRedirectPath

Function getProfileRedirectPath

apps/web/src/lib/user/server.ts:1170–1187  ·  view source on GitHub ↗
(user: User)

Source from the content-addressed store, hash-verified

1168 if (user.blocked_reason) {
1169 redirect('/account-blocked');
1170 }
1171 return user;
1172}
1173
1174export async function getUserFromBearerForCredentialExchange(
1175 requestHeaders: Headers,
1176 policy: KiloCredentialExchangeEligibilityPolicy
1177): Promise<GetAuthResponse> {
1178 const token = extractBearerToken(requestHeaders.get('authorization'));
1179 if (!token) return authError(401, 'Unauthorized', '?');
1180
1181 let auth: Awaited<ReturnType<typeof verifyKiloTokenForPolicy>>;
1182 try {
1183 auth = await verifyKiloTokenForPolicy(token, NEXTAUTH_SECRET, {
1184 audience: KILO_API_AUDIENCE,
1185 mode: 'allow-legacy',
1186 });
1187 } catch {
1188 return authError(401, 'Unauthorized', '?');
1189 }
1190

Callers 4

server.test.tsFile · 0.90
HomeFunction · 0.90
GETFunction · 0.90
GetStartedPageFunction · 0.90

Calls 3

Tested by

no test coverage detected