89 lines
4.6 KiB
Plaintext
89 lines
4.6 KiB
Plaintext
@page
|
|
@using System.Text.Encodings.Web
|
|
@using TightWiki.Models
|
|
@model LoginModel
|
|
@{
|
|
var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
|
|
}
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12 col-md-8 col-lg-4">
|
|
<section>
|
|
<form id="account" method="post">
|
|
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
|
|
<div class="form-floating mb-3">
|
|
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
|
|
<label asp-for="Input.Email" class="form-label">Email</label>
|
|
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
|
</div>
|
|
<div class="form-floating mb-3">
|
|
<input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="password" />
|
|
<label asp-for="Input.Password" class="form-label">Password</label>
|
|
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
|
</div>
|
|
<div class="checkbox mb-3">
|
|
<label asp-for="Input.RememberMe" class="form-label">
|
|
<input class="form-check-input" asp-for="Input.RememberMe" />
|
|
@Html.DisplayNameFor(m => m.Input.RememberMe)
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<button id="login-submit" type="submit" class="w-100 btn btn-lg btn-primary">Log in</button>
|
|
<br />
|
|
</div>
|
|
<div>
|
|
<p>
|
|
<a id="forgot-password" asp-page="./ForgotPassword">Forgot your password?</a>
|
|
<br />
|
|
@if (TightWiki.Models.GlobalConfiguration.AllowSignup == true)
|
|
{
|
|
<a asp-page="./Register" asp-route-returnUrl="@UrlEncoder.Default.Encode(Model.ReturnUrl)">Register as a new user</a>
|
|
<br />
|
|
}
|
|
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation">Resend email confirmation</a>
|
|
<br />
|
|
</p>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
<section>
|
|
@{
|
|
if ((Model.ExternalLogins?.Count ?? 0) > 0)
|
|
{
|
|
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@UrlEncoder.Default.Encode(Model.ReturnUrl)" method="post" class="form-horizontal">
|
|
<div>
|
|
<p>
|
|
@foreach (var provider in Model.ExternalLogins!)
|
|
{
|
|
if (provider.Name == "Google")
|
|
{
|
|
<button type="submit" class="btn w-100 mb-3 d-flex align-items-center" name="provider" value="@provider.Name" title="Log in using your Google account">
|
|
<img src="@GlobalConfiguration.BasePath/images/external/google-signin.svg" alt="Google" class="me-2" />
|
|
</button>
|
|
}
|
|
else if (provider.Name == "Microsoft")
|
|
{
|
|
<button type="submit" class="btn w-100 mb-3 d-flex align-items-center" name="provider" value="@provider.Name" title="Log in using your Microsoft account">
|
|
<img src="@GlobalConfiguration.BasePath/images/external/microsoft-signin.svg" alt="Microsoft" class="me-2" />
|
|
</button>
|
|
}
|
|
else
|
|
{
|
|
<button type="submit" class="btn btn-primary w-100 mb-3" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">
|
|
@provider.DisplayName
|
|
</button>
|
|
}
|
|
}
|
|
</p>
|
|
</div>
|
|
</form>
|
|
}
|
|
}
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
<partial name="_ValidationScriptsPartial" />
|
|
}
|