BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Supabase Library/social-auth-tanstack

Social Auth flow for TanStack and Supabase

supabase-library/social-auth-tanstack
FreeBlock

Social Auth flow for TanStack and Supabase

Install it

npx shadcn@latest add https://raw.githubusercontent.com/supabase/supabase/master/apps/ui-library/public/r/social-auth-tanstack.json

Source

registry/default/blocks/social-auth-tanstack/components/login-form.tsxraw.githubusercontent.com/supabase/supabase/master/apps/ui-library/public/r/social-auth-tanstack.json
1import { useState } from 'react'
2
3import { cn } from '@/lib/utils'
4import { createClient } from '@/registry/default/clients/tanstack/lib/supabase/client'
5import { Button } from '@/registry/default/components/ui/button'
6import {
7 Card,
8 CardContent,
9 CardDescription,
10 CardHeader,
11 CardTitle,
12} from '@/registry/default/components/ui/card'
13
14export function LoginForm({ className, ...props }: React.ComponentPropsWithoutRef<'div'>) {
15 const [error, setError] = useState<string | null>(null)
16 const [isLoading, setIsLoading] = useState(false)
17
18 const handleSocialLogin = async (e: React.FormEvent) => {
19 e.preventDefault()
20 const supabase = createClient()
21 setIsLoading(true)
22 setError(null)
23
24 try {
25 const { error } = await supabase.auth.signInWithOAuth({
26 provider: 'github',
27 options: {
28 redirectTo: `${window.location.origin}/auth/oauth?next=/protected`,
29 },
30 })
31
32 if (error) throw error
33 } catch (error: unknown) {
34 setError(error instanceof Error ? error.message : 'An error occurred')
35 setIsLoading(false)
36 }
37 }
38
39 return (
40 <div className={cn('flex flex-col gap-6', className)} {...props}>
41 <Card>
42 <CardHeader>
43 <CardTitle className="text-2xl">Welcome!</CardTitle>
44 <CardDescription>Sign in to your account to continue</CardDescription>
45 </CardHeader>
46 <CardContent>
47 <form onSubmit={handleSocialLogin}>
48 <div className="flex flex-col gap-6">
49 {error && <p className="text-sm text-destructive-500">{error}</p>}
50 <Button type="submit" className="w-full" disabled={isLoading}>
51 {isLoading ? 'Logging in...' : 'Continue with GitHub'}
52 </Button>
53 </div>
54 </form>
55 </CardContent>
56 </Card>
57 </div>
58 )
59}

What it pulls in

npm packages

  • @supabase/ssr@latest
  • @supabase/supabase-js@latest

Other registry items

  • button
  • card

Files it writes

  • registry/default/blocks/social-auth-tanstack/components/login-form.tsx
  • registry/default/blocks/social-auth-tanstack/lib/supabase/fetch-user-server-fn.ts
  • registry/default/blocks/social-auth-tanstack/routes/_protected.tsx
  • registry/default/blocks/social-auth-tanstack/routes/_protected/protected.tsx
  • registry/default/blocks/social-auth-tanstack/routes/auth/error.tsx
  • registry/default/blocks/social-auth-tanstack/routes/auth/oauth.ts
  • registry/default/blocks/social-auth-tanstack/routes/login.tsx
  • registry/default/clients/tanstack/lib/supabase/client.ts
  • registry/default/clients/tanstack/lib/supabase/server.ts

Facts

Registry
Supabase Library
Type
registry:block
Access
Free
Files written
9
Licence
Apache-2.0
First indexed
2026-08-11
Last confirmed
today

Go to the source

supabase.com supabase/supabase on GitHub Raw registry item This item as JSON

More from Supabase Library

All 60 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Current User Avatarcurrent-user-avatar-nuxtjsSupabase LibraryBlocksFree1 dep · 3 files
Current User Avatarcurrent-user-avatar-vueSupabase LibraryBlocksFree1 dep · 3 files
Dropzone (File Upload) for Nuxt and Supabasedropzone-nuxtjsSupabase LibraryBlocksFree3 deps · 4 files
Dropzone (File Upload) for Vue and Supabasedropzone-vueSupabase LibraryBlocksFree3 deps · 4 files
Infinite Query Hookinfinite-query-hookSupabase LibraryBlocksFree2 deps
Password Based Auth flow for Nextjs and Supabasepassword-based-auth-nextjsSupabase LibraryBlocksFree2 deps · 17 files
Password Based Auth flow for Nuxt.js and Supabasepassword-based-auth-nuxtjsSupabase LibraryBlocksFree2 deps · 12 files
Password Based Auth flow for React and Supabasepassword-based-auth-reactSupabase LibraryBlocksFree1 dep · 5 files
BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex