matchlogin-pagemode: handle-page
$method/context/request/@method
$action/context/request/params/param[@name='action']/@value
when$method = 'POST' and $action = 'login'
callhandle-login
when$action = 'logout'
callhandle-logout
matchlogin-pagemode: render-page
$error/context/request/params/param[@name='error']/@value
$lang/context/@lang
html
head
title
when$lang = 'lv'
otherwise
link relstylesheet href/static/vendor/tailwind.css
body bg-gray-50
div min-h-screenflexitems-centerjustify-center
div max-w-mdw-fullspace-y-8
div
h2 mt-6text-centertext-3xlfont-extraboldtext-gray-900
when$lang = 'lv'
otherwise
if$error
div mt-4bg-red-50borderborder-red-200text-red-600px-4py-3rounded
when$error = 'invalid_credentials'
when$lang = 'lv'
otherwise
when$error = 'session_invalid'
when$lang = 'lv'
otherwise
otherwise
$error
div rounded-mdshadow-sm-space-y-px
div
when$lang = 'lv'
otherwise
placeholder
when$lang = 'lv'
otherwise
div
when$lang = 'lv'
otherwise
placeholder
when$lang = 'lv'
otherwise
div
when$lang = 'lv'
otherwise
Development mode hint
if/context/environment/@mode = 'development'
div mt-4p-4bg-blue-50borderborder-blue-200roundedtext-smtext-blue-700
p font-semibold
Development Mode
p
Use these credentials:
ul mt-2
li
Email: admin@example.com
li
Password: devpass123
templatehandle-login
$email/context/request/params/param[@name='email']/@value
$password/context/request/params/param[@name='password']/@value
$auth-valid/context/auth/@valid = 'true'
$auth-user/context/auth/user
when$auth-valid and $auth-user
$auth-user/@id $auth-user/@name $auth-user/@email $auth-user/@role
otherwise
templatehandle-logout