mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-04-19 19:14:51 +00:00
68 lines
No EOL
1.9 KiB
Text
68 lines
No EOL
1.9 KiB
Text
@page "/login"
|
|
@using LBPUnion.ProjectLighthouse.Configuration
|
|
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.LoginForm
|
|
|
|
@{
|
|
Layout = "Layouts/BaseLayout";
|
|
Model.Title = "Log in";
|
|
}
|
|
|
|
<script src="https://geraintluff.github.io/sha256/sha256.min.js"></script>
|
|
|
|
<script>
|
|
function onSubmit(form) {
|
|
const passwordInput = document.getElementById("password");
|
|
const passwordSubmit = document.getElementById("password-submit");
|
|
|
|
passwordSubmit.value = sha256(passwordInput.value);
|
|
|
|
return true;
|
|
}
|
|
</script>
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
|
{
|
|
<div class="ui negative message">
|
|
<div class="header">
|
|
Uh oh!
|
|
</div>
|
|
<p style="white-space: pre-line">@Model.Error</p>
|
|
</div>
|
|
}
|
|
|
|
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
|
@Html.AntiForgeryToken()
|
|
|
|
<div class="field">
|
|
<label>Username</label>
|
|
<div class="ui left icon input">
|
|
<input type="text" name="username" id="text" placeholder="Username">
|
|
<i class="user icon"></i>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label>Password</label>
|
|
<div class="ui left icon input">
|
|
<input type="password" id="password" placeholder="Password">
|
|
<input type="hidden" id="password-submit" name="password">
|
|
<i class="lock icon"></i>
|
|
</div>
|
|
</div>
|
|
|
|
@if (ServerConfiguration.Instance.Captcha.CaptchaEnabled)
|
|
{
|
|
@await Html.PartialAsync("Partials/CaptchaPartial")
|
|
}
|
|
|
|
<input type="submit" value="Log in" id="submit" class="ui blue button">
|
|
@if (ServerConfiguration.Instance.Authentication.RegistrationEnabled)
|
|
{
|
|
<a href="/register">
|
|
<div class="ui button">
|
|
<i class="user alternate add icon"></i>
|
|
Register
|
|
</div>
|
|
</a>
|
|
}
|
|
</form> |