Liking cljdoc? Tell your friends :D

boundary.user.shell.web-handlers

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.

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.
raw docstring

audit-page-handlerclj

(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
sourceraw docstring

audit-table-fragment-handlerclj

(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
sourceraw docstring

bulk-update-users-htmx-handlerclj

(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.
sourceraw docstring

create-user-htmx-handlerclj

(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
sourceraw docstring

create-user-page-handlerclj

(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
sourceraw docstring

dashboard-page-handlerclj

(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
sourceraw docstring

delete-user-htmx-handlerclj

(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
sourceraw docstring

hard-delete-user-handlerclj

(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
sourceraw docstring

home-page-handlerclj

(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
sourceraw docstring

login-page-handlerclj

(login-page-handler config)

GET /web/login - render login page.

GET /web/login - render login page.
sourceraw docstring

login-submit-handlerclj

(login-submit-handler user-service config)

POST /web/login - validate credentials, authenticate, set session cookie.

POST /web/login - validate credentials, authenticate, set session cookie.
sourceraw docstring

logout-handlerclj

(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.
sourceraw docstring

mfa-backup-codes-page-handlerclj

(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
sourceraw docstring

mfa-disable-handlerclj

(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
sourceraw docstring

mfa-disable-page-handlerclj

(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
sourceraw docstring

mfa-setup-initiate-handlerclj

(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
sourceraw docstring

mfa-setup-page-handlerclj

(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
sourceraw docstring

mfa-verify-handlerclj

(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
sourceraw docstring

password-change-form-handlerclj

(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
sourceraw docstring

password-change-handlerclj

(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
sourceraw docstring

password-section-fragment-handlerclj

(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).
sourceraw docstring

preferences-edit-form-handlerclj

(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
sourceraw docstring

preferences-edit-handlerclj

(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
sourceraw docstring

preferences-fragment-handlerclj

(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).
sourceraw docstring

profile-edit-form-handlerclj

(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
sourceraw docstring

profile-edit-handlerclj

(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
sourceraw docstring

profile-info-fragment-handlerclj

(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).
sourceraw docstring

profile-page-handlerclj

(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
sourceraw docstring

register-page-handlerclj

(register-page-handler _config)

GET /web/register - render self-service registration page.

GET /web/register - render self-service registration page.
sourceraw docstring

register-submit-handlerclj

(register-submit-handler user-service config)

POST /web/register - validate data, create user account.

POST /web/register - validate data, create user account.
sourceraw docstring

revoke-all-sessions-handlerclj

(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
sourceraw docstring

revoke-session-handlerclj

(revoke-session-handler user-service _config)

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

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
sourceraw docstring

update-user-htmx-handlerclj

(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
sourceraw docstring

user-detail-page-handlerclj

(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
sourceraw docstring

user-sessions-page-handlerclj

(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
sourceraw docstring

users-page-handlerclj

(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).
sourceraw docstring

users-table-fragment-handlerclj

(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.
sourceraw docstring

web-root-page-handlerclj

(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
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close