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.
(account-recovery-allowed? actor target-id)Whether actor may unlock user target-id or reset their second factor: a
platform admin, as for the audit trail, and not on their own account, whose
second factor the profile turns off with a password or code.
Whether `actor` may unlock user `target-id` or reset their second factor: a platform admin, as for the audit trail, and not on their own account, whose second factor the profile turns off with a password or code.
(audit-page-handler user-service _config)Handler for the audit trail page (GET /web/audit). Its own controls request this URL and push it, so the address bar holds sort, filters and page; they get the table fragment back.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for the audit trail page (GET /web/audit). Its own controls request this URL and push it, so the address bar holds sort, filters and page; they get the table fragment back. 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), for callers that ask for the table alone.
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for the audit table fragment (GET /web/audit/table), for callers that ask for the table alone. 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
(error-page request error)The page a browser sees in place of an error body on a /web request:
platform's :error-page, which this module supplies.
The page a browser sees in place of an error body on a /web request: platform's `:error-page`, which this module supplies.
(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
(html-response request html)(html-response request html status)(html-response request html status extra-headers)Create HTML response map, resolving any [:t ...] i18n markers in the Hiccup tree.
Args: request: Ring request map (used to extract :i18n/t translation function) html: HTML string or Hiccup structure status: HTTP status code (optional, defaults to 200) headers: Additional headers map (optional)
Returns: Ring response map
Create HTML response map, resolving any [:t ...] i18n markers in the Hiccup tree. Args: request: Ring request map (used to extract :i18n/t translation function) html: HTML string or Hiccup structure status: HTTP status code (optional, defaults to 200) headers: Additional headers map (optional) Returns: Ring response map
(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 mfa-service config)Handler for MFA disable submission (POST /web/profile/mfa/disable).
Checks the password or code and disables MFA; see mfa/disable-mfa.
Args: mfa-service: MFA service instance config: Application configuration map
Returns: Ring handler function
Handler for MFA disable submission (POST /web/profile/mfa/disable). Checks the password or code and disables MFA; see `mfa/disable-mfa`. Args: 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).
Asks for the password or an authentication code.
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). Asks for the password or an authentication code. Args: mfa-service: MFA service instance config: Application configuration map Returns: Ring handler function
(mfa-enrolment-page-handler mfa-service config)GET /web/login/mfa-setup - the authenticator setup for a user the app requires a second factor of, who has none.
GET /web/login/mfa-setup - the authenticator setup for a user the app requires a second factor of, who has none.
(mfa-enrolment-submit-handler mfa-service config)POST /web/login/mfa-setup - check the first code and turn the second factor on. The user then signs in with it.
POST /web/login/mfa-setup - check the first code and turn the second factor on. The user then signs in with it.
(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
(oidc-callback-handler oidc-client config)GET /web/auth/oidc/:provider/callback - finish the sign-in.
GET /web/auth/oidc/:provider/callback - finish the sign-in.
(oidc-mfa-handler oidc-client config)POST /web/auth/oidc/mfa - the second factor after a provider sign-in.
POST /web/auth/oidc/mfa - the second factor after a provider sign-in.
(oidc-start-handler oidc-client config)GET /web/auth/oidc/:provider/start - send the browser to the provider.
GET /web/auth/oidc/:provider/start - send the browser to the provider.
(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.
(reset-mfa-handler user-service _config)POST /web/users/:id/mfa/reset: turns off the user's second factor (admin).
POST /web/users/:id/mfa/reset: turns off the user's second factor (admin).
(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 POST /web/users/:id/sessions/:session-id/revoke: ends one of the user's sessions, forcing that device to sign in again. Sessions are named by id; the page never sees a token (BOU-696).
Args: user-service: User service instance config: Application configuration map
Returns: Ring handler function
Handler for POST /web/users/:id/sessions/:session-id/revoke: ends one of the user's sessions, forcing that device to sign in again. Sessions are named by id; the page never sees a token (BOU-696). Args: user-service: User service instance config: Application configuration map Returns: Ring handler function
(unlock-user-handler user-service _config)POST /web/users/:id/unlock: ends the user's sign-in lockout (admin).
POST /web/users/:id/unlock: ends the user's sign-in lockout (admin).
(user-detail-redirect request)GET /web/users/:id, the user's page before the admin's edit page replaced it: a redirect there, so old links keep working. Not an id: the list.
GET /web/users/:id, the user's page before the admin's edit page replaced it: a redirect there, so old links keep working. Not an id: the list.
(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), with shared search filters (q, role, status). The table's controls request this URL and push it, so the address bar holds sort, filters and page; they get the table fragment back.
Handler for the users listing page (GET /web/users), with shared search filters (q, role, status). The table's controls request this URL and push it, so the address bar holds sort, filters and page; they get the table fragment back.
(users-table-fragment-handler user-service _config)Handler for the users table fragment (GET /web/users/table), for callers that ask for the table alone. The table's own controls request /web/users.
Handler for the users table fragment (GET /web/users/table), for callers that ask for the table alone. The table's own controls request /web/users.
(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 their
landing page. With :landing set, everyone is redirected there.
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 their landing page. With `:landing` set, everyone is redirected there. 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 |