Extracts credentials from a request and verifies them in a single step.
This is a convenience function that combines extractCredentials and verifyCredentials. Use it when you want the full auth flow without needing to inspect the raw credentials.
The incoming HTTP request.
Auth modes to accept and optional environment overrides.
import { verifyAuth } from '@supabase/server/core'
const { data: auth, error } = await verifyAuth(request, {
auth: 'user',
})
if (error) {
return Response.json({ message: error.message }, { status: error.status })
}
console.log(auth.userClaims!.id) // "d0f1a2b3-..."