MonoCloud Authentication SDK
    Preparing search index...

    Represents an outgoing HTTP response with common helper methods.

    interface MonoCloudResponse {
        done(): any;
        internalServerError(): void;
        methodNotAllowed(): void;
        noContent(): void;
        notFound(): void;
        redirect(url: string, statusCode?: number): void;
        sendJson(data: any, statusCode?: number): void;
        setCookie(
            cookieName: string,
            value: string,
            options: CookieOptions,
        ): Promise<void>;
        setNoCache(): void;
    }

    Hierarchy

    Index
    • Finalizes and returns the response.

      Returns any

    • Sends a 500 Internal Server Error response.

      Returns void

    • Sends a 405 Method Not Allowed response.

      Returns void

    • Sends a 204 No Content response.

      Returns void

    • Sends a 404 Not Found response.

      Returns void

    • Redirects the client to the specified URL.

      Parameters

      • url: string

        The URL to redirect to.

      • OptionalstatusCode: number

        The HTTP status code to use for the redirect.

      Returns void

    • Sends a JSON response with an optional status code.

      Parameters

      • data: any

        The data to serialize and send as JSON.

      • OptionalstatusCode: number

        The HTTP status code for the response.

      Returns void

    • Sets a cookie on the response.

      Parameters

      • cookieName: string

        The name of the cookie to set.

      • value: string

        The value to assign to the cookie.

      • options: CookieOptions

        Serialization options for the cookie.

      Returns Promise<void>

    • Sets cache-control headers to prevent caching.

      Returns void