@supabase/server - v0.2.0
    Preparing search index...

    Function verifyCredentials

    • 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.

      Parameters

      • credentials: Credentials

        The credentials to verify (from extractCredentials).

      • options: VerifyCredentialsOptions

        Allowed auth modes and optional env overrides.

      Returns Promise<{ data: AuthResult; error: null } | { data: null; error: AuthError }>

      { data: AuthResult, error: null } on success, { data: null, error: AuthError } on failure.

      const credentials = extractCredentials(request)
      const { data: auth, error } = await verifyCredentials(credentials, {
      allow: ['user', 'public'],
      })
      if (error) {
      return Response.json({ message: error.message }, { status: error.status })
      }