@model ApeosConnector.Models.LoginModel
@{
    Layout = "~/Views/Shared/_LoginLayout.cshtml";
    var username = "";
    var password = "";
}

@using (Html.BeginForm("Index", "Login", FormMethod.Post, new { @id = "login_form", role = "form" }))
{
    <label class="full-label">Username</label>
    @Html.TextBoxFor(m => m.Username)
    <br>
    <br>

    <label class="full-label">Password</label>
    @Html.PasswordFor(m => m.Password)

    <br>
    <br>
    @Html.HiddenFor(m => m.AuthType, "SecureAuth");
    <input type="submit" value="Login" class="right">
}

@section scripts {
    <script>
        cAlert("@ViewBag.ErrorMessage");

        window.onload = function () {
            sessionStorage.clear();

            if ($('#Username').value != '' && $('#Password').value != '') {
                $('#login_form').submit();
            }
        };
    </script>
}