Custom Login Pages
This is the canonical reference for building custom authentication pages in BetterForms.
Use this page together with:
What This Page Covers
Custom login pages are regular BetterForms pages that run authentication actions.
Hooks are server calls.
Actions and named actions are client-side workflows.
A named action can include a
runUtilityHookaction when a workflow needs to call the server.
Recommended Authentication Pages
If you are replacing the default authentication UI, create pages for the flows your app needs and assign the correct navigation slugs.
Login
login
authLogin
Register
login/signup
authRegister
Email Verification
login/verify
authVerify
Password Reset
login/reset
authReset
Magic Link Landing Page
login/magic
authLogin
Notes:
authVerifyis typically run from anonFormLoadnamed action so the verification page can consume the token immediately after the user opens the email link.authLoginsupports both email/password login and token-based magic-link login.authResendis useful as a button or link on an existing page. The current docs do not define a required dedicated slug for it, so only document a custom standalone page for resend if your app needs one.OAuth callback handling is documented separately in OAuth.
Recommended Flow Mapping
Login page:
authLoginLogout button or link:
authLogoutRegistration page:
authRegisterForgot-password page:
authForgotReset page:
authResetVerification page:
authVerifyMagic-link request page:
authMagicRequestMagic-link landing page:
authLogin
Form Design Notes
Use isForm
isFormIf the page contains a login form, enable isForm so pressing Enter can submit the credentials flow more naturally.
Enable browser autofill
For the password field:
For the email field:
Autofocus
If you want the cursor to land in the email field on page load, add:
For later focus changes after page load, use setFocus.
Auth Feedback Display
Authentication pages can now read auth feedback from:
model.authMessagemodel.authMessageCodemodel.authMessageTypeBF.authGetLastFeedback()
model.authMessage is still supported for backward compatibility, but for new pages it is better to branch on model.authMessageCode and model.authMessageType rather than matching English strings.
Example:
Recommended pattern:
Security notes:
Avoid UI that reveals whether a specific email exists in the system.
Prefer mapping from
auth.*codes to your own localized text rather than parsing raw message text.For login, reset, and magic-link request pages, use calm generic fallback strings by default.
Related Pages
Last updated
Was this helpful?