Login: Create a Working User Login Page
See the real Demo Projects HQ login flow, from the page form to the shared Security Provider.
Demo Projects HQ shows the full login chain
Section titled “Demo Projects HQ shows the full login chain”Use Demo Projects HQ as the reference implementation for login because it shows the full chain clearly. The frontend page is views/login.ejs. Its login_form submits to /api/auth/login through a dmx-serverconnect-form. On success it redirects to /, and on 401 it shows a focused invalid-credentials message.
The backend action is app/api/auth/login.json. It accepts username, password, and remember, then runs auth.login with the shared security provider. That provider is defined in app/modules/SecurityProviders/security.json as a Database provider against the users table, with password verification enabled and an admin permission derived from the role column.
That is the modern login mental model to teach: one shared provider, one login action, one page form, and protected routes that reuse the same identity and permission state after sign-in.
Working login flow
Section titled “Working login flow”Start with the shared provider and form wiring, then follow the same identity into protected pages and secure actions.