Skip to content
Download

allowCredentials

mach::CorsBuilder::allowCredentials

Configures credentials support.

Configures whether credentials are allowed in cross-origin requests.

CorsBuilder& allowCredentials(bool enabled = true);

A reference to the current CorsBuilder instance.

Parameter Description
enabled Whether credentials are allowed. Defaults to true.

Credentials cannot be enabled when all origins are allowed using allowAnyOrigin().

This method is not thread-safe and should only be called during CORS configuration.

cors.allowCredentials();
Name Description
allowAnyOrigin Allows requests from any origin.