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/password-based-auth-react-router

Password Based Auth flow for React Router and Supabase

supabase-library/password-based-auth-react-router
FreeBlock

Password Based Auth flow for React Router and Supabase

Install it

npx shadcn@latest add https://raw.githubusercontent.com/supabase/supabase/master/apps/ui-library/public/r/password-based-auth-react-router.json

Source

registry/default/blocks/password-based-auth-react-router/app/routes/auth.confirm.tsxraw.githubusercontent.com/supabase/supabase/master/apps/ui-library/public/r/password-based-auth-react-router.json
1import { type EmailOtpType } from '@supabase/supabase-js'
2import { redirect, type LoaderFunctionArgs } from 'react-router'
3
4import { createClient } from '@/registry/default/clients/react-router/lib/supabase/server'
5
6export async function loader({ request }: LoaderFunctionArgs) {
7 const requestUrl = new URL(request.url)
8 const token_hash = requestUrl.searchParams.get('token_hash')
9 const type = requestUrl.searchParams.get('type') as EmailOtpType | null
10 const _next = requestUrl.searchParams.get('next')
11 const next = _next?.startsWith('/') ? _next : '/'
12
13 if (token_hash && type) {
14 const { supabase, headers } = createClient(request)
15 const { error } = await supabase.auth.verifyOtp({
16 type,
17 token_hash,
18 })
19 if (!error) {
20 return redirect(next, { headers })
21 } else {
22 return redirect(`/auth/error?error=${error?.message}`)
23 }
24 }
25
26 // redirect the user to an error page with some instructions
27 return redirect(`/auth/error?error=No token hash or type`)
28}

What it pulls in

npm packages

  • @supabase/ssr@latest
  • @react-router/dev@latest
  • @react-router/fs-routes@latest
  • @supabase/supabase-js@latest

Other registry items

  • button
  • card
  • input
  • label

Files it writes

  • registry/default/blocks/password-based-auth-react-router/app/routes/auth.confirm.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/auth.error.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/forgot-password.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/login.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/logout.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/protected.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/sign-up.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes/update-password.tsx
  • registry/default/blocks/password-based-auth-react-router/app/routes.ts
  • registry/default/clients/react-router/lib/supabase/client.ts
  • registry/default/clients/react-router/lib/supabase/server.ts

Facts

Registry
Supabase Library
Type
registry:block
Access
Free
Files written
11
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