Web UI handlers for user module.
This namespace implements Ring handlers that return HTML responses for user-related web pages, either full pages or HTMX partial updates.
Handler Categories:
All handlers use the shared UI components and user shell services.
Web UI handlers for user module. This namespace implements Ring handlers that return HTML responses for user-related web pages, either full pages or HTMX partial updates. Handler Categories: - Page Handlers: Return full HTML pages for initial browser requests - HTMX Handlers: Return HTML fragments for dynamic updates All handlers use the shared UI components and user shell services.
(audit-page-handler user-service _config)Handler for the audit trail page (GET /web/audit).
Displays audit logs in a table with filtering, sorting, and pagination. Supports filters for action type, result, target email, and actor email.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for the audit trail page (GET /web/audit). Displays audit logs in a table with filtering, sorting, and pagination. Supports filters for action type, result, target email, and actor email. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(audit-table-fragment-handler user-service _config)Handler for the audit table fragment (GET /web/audit/table).
Returns only the audit table HTML for HTMX refresh when filters change. This enables client-side filtering without full page reload.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for the audit table fragment (GET /web/audit/table). Returns only the audit table HTML for HTMX refresh when filters change. This enables client-side filtering without full page reload. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(bulk-update-users-htmx-handler user-service config)HTMX handler for bulk user operations (POST /web/users/bulk).
Supports multiple actions: deactivate, activate, delete, role changes. Returns the updated users table fragment using the same query parameters and filters as the current view.
HTMX handler for bulk user operations (POST /web/users/bulk). Supports multiple actions: deactivate, activate, delete, role changes. Returns the updated users table fragment using the same query parameters and filters as the current view.
(create-user-htmx-handler user-service email-sender config)HTMX handler for creating a new user (POST /web/users).
Validates form data and on success instructs HTMX to navigate back to the
caller-provided return-to URL (validated via safe-return-url), falling
back to the admin users list. Uses the HX-Redirect response header rather
than injecting JavaScript so the URL value never reaches an HTML/JS context.
Args: user-service: User service instance email-sender: Optional ISmtpProvider for sending welcome emails config: Application configuration map
Returns: Ring handler function
HTMX handler for creating a new user (POST /web/users). Validates form data and on success instructs HTMX to navigate back to the caller-provided `return-to` URL (validated via `safe-return-url`), falling back to the admin users list. Uses the `HX-Redirect` response header rather than injecting JavaScript so the URL value never reaches an HTML/JS context. Args: user-service: User service instance email-sender: Optional ISmtpProvider for sending welcome emails config: Application configuration map Returns: Ring handler function
(create-user-page-handler _config)Handler for the create user page (GET /web/users/new).
Args: config: Application configuration map
Returns: Ring handler function
Handler for the create user page (GET /web/users/new). Args: config: Application configuration map Returns: Ring handler function
(dashboard-page-handler user-service mfa-service config)Handler for the dashboard page (GET /web/dashboard).
Shows a welcome page with quick links and account statistics.
Args:
user-service: User service instance
mfa-service: MFA service instance
config: Application configuration map
Returns: Ring handler function
Handler for the dashboard page (GET /web/dashboard). Shows a welcome page with quick links and account statistics. Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(delete-user-htmx-handler user-service _config)HTMX handler for deactivating a user (DELETE /web/users/:id).
Performs soft delete via deactivate-user.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
HTMX handler for deactivating a user (DELETE /web/users/:id). Performs soft delete via deactivate-user. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(hard-delete-user-handler user-service _config)Handler for permanently deleting a user (POST /web/users/:id/hard-delete).
⚠️ IRREVERSIBLE OPERATION - Permanently removes user and all related data. Should only be used for GDPR compliance or similar requirements. Requires admin role.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for permanently deleting a user (POST /web/users/:id/hard-delete). ⚠️ IRREVERSIBLE OPERATION - Permanently removes user and all related data. Should only be used for GDPR compliance or similar requirements. Requires admin role. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(home-page-handler _config)Handler for the home/landing page (GET /).
Redirects authenticated users to /web/dashboard, unauthenticated to /web.
Args: config: Application configuration map
Returns: Ring handler function
Handler for the home/landing page (GET /). Redirects authenticated users to /web/dashboard, unauthenticated to /web. Args: config: Application configuration map Returns: Ring handler function
(login-page-handler config)GET /web/login - render login page.
GET /web/login - render login page.
(login-submit-handler user-service config)POST /web/login - validate credentials, authenticate, set session cookie.
POST /web/login - validate credentials, authenticate, set session cookie.
(logout-handler user-service _config)POST /web/logout - clear session cookie and redirect to home.
POST /web/logout - clear session cookie and redirect to home.
(mfa-backup-codes-page-handler _mfa-service _config)Handler for backup codes display page (GET /web/profile/mfa/backup-codes).
Shows backup codes after MFA enable or regeneration.
Args: mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for backup codes display page (GET /web/profile/mfa/backup-codes). Shows backup codes after MFA enable or regeneration. Args: mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(mfa-disable-handler user-service mfa-service _config)Handler for MFA disable submission (POST /web/profile/mfa/disable).
Verifies password and disables MFA.
Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for MFA disable submission (POST /web/profile/mfa/disable). Verifies password and disables MFA. Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(mfa-disable-page-handler _mfa-service _config)Handler for MFA disable confirmation page (GET /web/profile/mfa/disable).
Shows password confirmation form to disable MFA.
Args: mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for MFA disable confirmation page (GET /web/profile/mfa/disable). Shows password confirmation form to disable MFA. Args: mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(mfa-setup-initiate-handler mfa-service _config)Handler for MFA setup initiation (POST /web/profile/mfa/setup).
HTMX handler that generates QR code and returns setup form.
Args: mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for MFA setup initiation (POST /web/profile/mfa/setup). HTMX handler that generates QR code and returns setup form. Args: mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(mfa-setup-page-handler _mfa-service _config)Handler for MFA setup page (GET /web/profile/mfa/setup).
Shows introduction and start button for MFA setup.
Args: mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for MFA setup page (GET /web/profile/mfa/setup). Shows introduction and start button for MFA setup. Args: mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(mfa-verify-handler mfa-service config)Handler for MFA code verification (POST /web/profile/mfa/verify).
HTMX handler that verifies TOTP code and enables MFA.
Args: mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for MFA code verification (POST /web/profile/mfa/verify). HTMX handler that verifies TOTP code and enables MFA. Args: mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(password-change-form-handler _config)Handler to show password change form (GET /web/profile/password/form).
HTMX handler that returns expanded password change card.
Args: config: Application configuration map
Returns: Ring handler function
Handler to show password change form (GET /web/profile/password/form). HTMX handler that returns expanded password change card. Args: config: Application configuration map Returns: Ring handler function
(password-change-handler user-service _config)Handler for password change submission (POST /web/profile/password).
HTMX handler that validates and changes password.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for password change submission (POST /web/profile/password). HTMX handler that validates and changes password. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(password-section-fragment-handler _config)Handler to show collapsed password section fragment (GET /web/profile/password).
Handler to show collapsed password section fragment (GET /web/profile/password).
(preferences-edit-form-handler user-service _config)Handler to show preferences edit form (GET /web/profile/preferences/edit).
HTMX handler that returns the edit form fragment.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler to show preferences edit form (GET /web/profile/preferences/edit). HTMX handler that returns the edit form fragment. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(preferences-edit-handler user-service _config)Handler for preferences edit submission (POST /web/profile/preferences).
HTMX handler that updates preferences and returns updated card.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for preferences edit submission (POST /web/profile/preferences). HTMX handler that updates preferences and returns updated card. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(preferences-fragment-handler user-service _config)Handler to return preferences card fragment (GET /web/profile/preferences).
Handler to return preferences card fragment (GET /web/profile/preferences).
(profile-edit-form-handler user-service _config)Handler to show profile edit form (GET /web/profile/edit).
HTMX handler that returns the edit form fragment.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler to show profile edit form (GET /web/profile/edit). HTMX handler that returns the edit form fragment. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(profile-edit-handler user-service _config)Handler for profile edit submission (POST /web/profile).
HTMX handler that updates profile and returns updated card.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for profile edit submission (POST /web/profile). HTMX handler that updates profile and returns updated card. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(profile-info-fragment-handler user-service _config)Handler to return profile info card fragment (GET /web/profile/info).
Handler to return profile info card fragment (GET /web/profile/info).
(profile-page-handler user-service mfa-service _config)Handler for the profile page (GET /web/profile).
Displays user profile with all sections: info, preferences, security, MFA.
Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for the profile page (GET /web/profile). Displays user profile with all sections: info, preferences, security, MFA. Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(register-page-handler _config)GET /web/register - render self-service registration page.
GET /web/register - render self-service registration page.
(register-submit-handler user-service config)POST /web/register - validate data, create user account.
POST /web/register - validate data, create user account.
(revoke-all-sessions-handler user-service _config)Handler for revoking all user sessions (POST /web/users/:id/sessions/revoke-all).
Invalidates all sessions for a user, optionally keeping the current session active.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for revoking all user sessions (POST /web/users/:id/sessions/revoke-all). Invalidates all sessions for a user, optionally keeping the current session active. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(revoke-session-handler user-service _config)Handler for revoking a single session.
Supports:
Invalidates the specified session token, forcing that device to sign in again.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for revoking a single session. Supports: - POST /web/sessions/revoke (preferred; token in form param) - POST /web/sessions/:token/revoke (legacy; token in path) Invalidates the specified session token, forcing that device to sign in again. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(update-user-htmx-handler user-service _config)HTMX handler for updating a user (PUT /web/users/:id).
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
HTMX handler for updating a user (PUT /web/users/:id). Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(user-detail-page-handler user-service _config)Handler for individual user detail page (GET /web/users/:id).
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for individual user detail page (GET /web/users/:id). Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(user-sessions-page-handler user-service _config)Handler for user sessions management page (GET /web/users/:id/sessions).
Displays all active sessions for a user with ability to revoke individual sessions or all sessions except current.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for user sessions management page (GET /web/users/:id/sessions). Displays all active sessions for a user with ability to revoke individual sessions or all sessions except current. Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(users-page-handler user-service _config)Handler for the users listing page (GET /web/users).
Fetches users from the user service and renders them in a table, with support for shared search filters (q, role, status).
Handler for the users listing page (GET /web/users). Fetches users from the user service and renders them in a table, with support for shared search filters (q, role, status).
(users-table-fragment-handler user-service _config)Handler for refreshing the users table (GET /web/users/table).
Returns only the table container fragment for HTMX replacement.
Handler for refreshing the users table (GET /web/users/table). Returns only the table container fragment for HTMX replacement.
(web-root-page-handler user-service _config)Handler for the web root landing page (GET /web).
Shows logo, welcome message and login link for unauthenticated users. Authenticated users (valid session cookie present) are redirected to the dashboard.
Args: user-service: User service instance for session validation _config: Application configuration map
Returns: Ring handler function
Handler for the web root landing page (GET /web). Shows logo, welcome message and login link for unauthenticated users. Authenticated users (valid session cookie present) are redirected to the dashboard. Args: user-service: User service instance for session validation _config: Application configuration map Returns: Ring handler function
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |