MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / LoginPage

Function LoginPage

web/src/app/login/page.tsx:16–47  ·  view source on GitHub ↗
({
  searchParams,
}: {
  searchParams?: Promise<{ [key: string]: string | string[] | undefined }>
})

Source from the content-addressed store, hash-verified

14
15// Server component that handles the auth code expiration check
16export default async function LoginPage({
17 searchParams,
18}: {
19 searchParams?: Promise<{ [key: string]: string | string[] | undefined }>
20}) {
21 const resolvedSearchParams = searchParams ? await searchParams : {}
22 const authCode = resolvedSearchParams?.auth_code as string | undefined
23
24 if (authCode) {
25 const { expiresAt } = parseAuthCode(authCode)
26
27 // Check for token expiration on the server side
28 if (expiresAt && isAuthCodeExpired(expiresAt)) {
29 return (
30 <Card>
31 <CardHeader>
32 <CardTitle>Uh-oh, spaghettio!</CardTitle>
33 <CardDescription>Auth code expired.</CardDescription>
34 </CardHeader>
35 <CardContent>
36 <p>
37 Please try starting Codebuff in your terminal again. If the
38 problem persists, reach out to {env.NEXT_PUBLIC_SUPPORT_EMAIL}.
39 </p>
40 </CardContent>
41 </Card>
42 )
43 }
44 }
45
46 return <LoginCard authCode={authCode} />
47}

Callers

nothing calls this directly

Calls 2

parseAuthCodeFunction · 0.90
isAuthCodeExpiredFunction · 0.90

Tested by

no test coverage detected