Form Example: Login Form

A user login form with username, password and 2FA options.

{
    "schema": {
        "type": "object",
        "properties": {
            "username": {
                "type": "string",
                "title": "Username or Email"
            },
            "password": {
                "type": "string",
                "title": "Password"
            },
            "twoFactorToken": {
                "type": "string",
                "title": "2FA Token (optional)",
                "description": "Enter your two-factor authentication code if enabled"
            }
        },
        "required": [
            "username",
            "password"
        ]
    },
    "data": {
        "username": "",
        "password": ""
    }
}
Enter your two-factor authentication code if enabled
{
    "type": "object",
    "properties": {
        "username": {
            "type": "string",
            "title": "Username or Email"
        },
        "password": {
            "type": "string",
            "title": "Password"
        },
        "twoFactorToken": {
            "type": "string",
            "title": "2FA Token (optional)",
            "description": "Enter your two-factor authentication code if enabled"
        }
    },
    "required": [
        "username",
        "password"
    ]
}
{
    "type": "VerticalLayout",
    "elements": [
        {
            "type": "Control",
            "label": "Username or Email",
            "scope": "#/properties/username"
        },
        {
            "type": "Control",
            "label": "Password",
            "scope": "#/properties/password"
        },
        {
            "type": "Control",
            "label": "2FA Token (optional)",
            "scope": "#/properties/twoFactorToken"
        }
    ]
}
{
    "username": "",
    "password": ""
}