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

Function handleSignIn

freebuff/web/src/components/sign-in/sign-in-button.tsx:28–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 const searchParams = useSearchParams() ?? new URLSearchParams()
27
28 const handleSignIn = () => {
29 startTransition(async () => {
30 const searchParamsString = searchParams.toString()
31 let callbackUrl =
32 pathname + (searchParamsString ? `?${searchParamsString}` : '')
33
34 const referrer = searchParams.get('referrer')
35 if (referrer) {
36 localStorage.setItem('freebuff_referrer', referrer)
37 }
38
39 if (pathname === '/login') {
40 const authCode = searchParams.get('auth_code')
41
42 if (authCode && isCliAuthCodeCandidate(authCode)) {
43 callbackUrl = getCliAuthOnboardPath(searchParams, authCode)
44 } else {
45 callbackUrl = '/'
46 }
47 }
48
49 await signIn(providerName, { callbackUrl })
50 })
51 }
52
53 const displayName =
54 providerName === 'github'

Callers

nothing calls this directly

Calls 3

isCliAuthCodeCandidateFunction · 0.90
getCliAuthOnboardPathFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected