Login: Create a Working User Login Page
See the real Demo Projects HQ login flow, from the page form to the shared Security Provider.
See the real Demo Projects HQ login flow, from the page form to the shared Security Provider.
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.