quivr/frontend/middleware.ts
Stan Girard f7e237905f
Feat auth (#142)
* feat(supabase): added auth

* feat(auth): working for front

* fix(auth): now front can build

* feat(auth): nice screen
2023-05-24 16:17:08 +02:00

12 lines
427 B
TypeScript

import { createMiddlewareSupabaseClient } from '@supabase/auth-helpers-nextjs'
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
// import type { Database } from '@/lib/database.types'
export async function middleware(req: NextRequest) {
const res = NextResponse.next()
const supabase = createMiddlewareSupabaseClient({ req, res })
await supabase.auth.getSession()
return res
}