duck.etc.blueprints.dashboard.ui.pages.login

LoginPage — authentication gateway for the Duck Framework dashboard.

Renders a full-page login form. On successful credential submission, authenticates via duck.contrib.auth, issues a JWT token, and redirects to the dashboard. Incorrect credentials re-render the form with an animated error state.

Module Contents

Classes

LoginPage

Full-page login screen for the dashboard JWT authentication flow.

Data

DASHBOARD_USER_ID

API

duck.etc.blueprints.dashboard.ui.pages.login.DASHBOARD_USER_ID

9999

class duck.etc.blueprints.dashboard.ui.pages.login.LoginPage(request, disable_lively: bool = False, lazy: bool = True, *args, **kwargs)[source]

Bases: duck.html.components.page.Page

Full-page login screen for the dashboard JWT authentication flow.

On submit, validates credentials, issues a JWT via the jwt backend, and redirects to the dashboard index. An error message animates in on failure without a full page reload.

Initialization

Initialize the Page component.

Parameters:
  • request – The target HTTP request.

  • disable_lively – This disables Lively components for the page. Defaults to False.

  • lazy – This makes the page not aggressively load the page tree on initialization but let the system decide the right time to load the page. Defaults to True.

_build_background_grid() duck.html.components.container.Container[source]

Returns a decorative SVG grid overlay for the background.

Returns:

A Container with the SVG background element.

_build_card() duck.html.components.container.Container[source]

Returns the centered login card with header, form, and footer.

Returns:

A Container styled as the login card.

Returns the card footer with security notice.

Returns:

A Container with the footer notice text.

_build_card_header() duck.html.components.container.Container[source]

Returns the card header with brand dot, title, and subtitle.

Returns:

A Container with the login card heading markup.

_build_form() duck.html.components.form.Form[source]

Returns the login Form component with username, password, and submit.

Returns:

A Form component with bound submit handler.

_build_layout() duck.html.components.container.Container[source]

Returns the full-screen centered login shell.

Returns:

A Container wrapping the login card.

_build_login_styles() duck.html.components.style.Style[source]

Returns all login-page-specific CSS rules.

Returns:

A Style component with login UI styles.

async _show_error_async(message: str, ws) None[source]

Updates the error label with an animated error message.

Parameters:
  • message – The error string to display.

  • ws – The active WebSocket connection for JS execution.

async handle_login(form, event: str, form_inputs: dict, ws) None[source]

Handles the login form submission.

Authenticates via duck.contrib.auth, issues a JWT via the jwt backend on success, and redirects to the dashboard. Shows an animated error message on failure.

Parameters:
  • form – The Form component that fired the event.

  • event – The event name string (“submit”).

  • form_inputs – Dict of {name: value} from all named form inputs.

  • ws – The active LivelyWebSocketView instance.

on_create() None[source]

Sets up page metadata, injects styles, and builds the login layout.