@supabase/server - v1.7.0
    Preparing search index...

    Class AuthError

    Thrown when authentication or authorization fails.

    Carries an HTTP status code suitable for returning directly in a response (401 when the request's credentials are at fault, 500 when the server is misconfigured and could not have authenticated anyone).

    import { createSupabaseContext } from '@supabase/server'

    const { data: ctx, error } = await createSupabaseContext(request, { auth: 'user' })
    if (error) {
    // error is an AuthError — `toJSON()` includes source, code, message, hint, docs, details
    return Response.json(error.toJSON(), { status: error.status })
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    source: "@supabase/server" = ErrorSource

    Always "@supabase/server".

    code: string

    Machine-readable error code.

    hint?: string

    Actionable next step, when one applies.

    docs: string

    Documentation URL for this error's code.

    details?: Record<string, unknown>

    Structured, non-sensitive diagnostics — accepted auth modes, which credential headers were present, configured key names, JWT header fields. Never key values or token payloads.

    status: number

    HTTP status code.

    Methods