Table of Contents

Class AuthStatusUpdateAttribute

Namespace
Htmx.Components.AuthStatus
Assembly
Htmx.Components.dll

Marks action methods that should trigger an update of the authentication status component when executed via HTMX requests. This attribute is used by the AuthStatusUpdateFilter to automatically inject updated authentication status into out-of-band responses.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class AuthStatusUpdateAttribute : Attribute
Inheritance
AuthStatusUpdateAttribute
Inherited Members
Extension Methods

Examples

[HttpPost]
[AuthStatusUpdate]
public async Task<IActionResult> Login(LoginModel model)
{
    // Login logic here
    return Ok();
}

Remarks

This attribute only affects HTMX requests. For regular HTTP requests, the authentication status component must be explicitly rendered in the view.