({ redirectTo }: { redirectTo?: string })
| 6 | import { Button } from "./ui/button"; |
| 7 | |
| 8 | export function GithubSignin({ redirectTo }: { redirectTo?: string }) { |
| 9 | const supabase = createClient(); |
| 10 | const searchParams = useSearchParams(); |
| 11 | const next = searchParams.get("next") ?? redirectTo ?? "/"; |
| 12 | |
| 13 | return ( |
| 14 | <Button |
| 15 | variant="outline" |
| 16 | className="border border-border rounded-full" |
| 17 | onClick={() => { |
| 18 | supabase.auth.signInWithOAuth({ |
| 19 | provider: "github", |
| 20 | options: { |
| 21 | redirectTo: `${window.location.origin}/auth/callback?next=${next}`, |
| 22 | }, |
| 23 | }); |
| 24 | }} |
| 25 | > |
| 26 | <span className="flex items-center gap-2"> |
| 27 | <GithubIcon className="size-4" /> |
| 28 | Sign in with GitHub |
| 29 | </span> |
| 30 | </Button> |
| 31 | ); |
| 32 | } |
nothing calls this directly
no test coverage detected