Verifies pre-extracted credentials against one or more allowed auth modes.
Tries each mode in order — first match wins. A mode is only tried when its credential is present; a JWT that is present but fails verification short-circuits the chain with InvalidCredentialsError instead of falling through to the next mode. Use verifyAuth to extract and verify in a single call.
The credentials to verify (from extractCredentials).
Allowed auth modes and optional env overrides.
const credentials = extractCredentials(request)
const { data: auth, error } = await verifyCredentials(credentials, {
auth: ['user', 'publishable'],
})
if (error) {
return Response.json({ message: error.message }, { status: error.status })
}