Add authentication

This commit is contained in:
Robert Marshall 2020-01-03 13:32:20 +00:00
parent 8f0c4c0a45
commit a2d84e182d
11 changed files with 206 additions and 21 deletions

View file

@ -0,0 +1,8 @@
@model object
@{
ViewBag.Title = "title";
Layout = "_Layout";
}
<h2>title</h2>

View file

@ -0,0 +1,20 @@
@model LoginViewModel
@{
ViewBag.Title = "Login";
}
@if (!string.IsNullOrEmpty(Model.ReturnUrl)) {
<div>Please log in to perform that action</div>
}
@if (Model.FailedAttempt) {
<div>Could not log in with those credentials</div>
}
<form method="post" action="login">
<input type="hidden" name="returnUrl" value="@Model.ReturnUrl"/>
<label for="username">Username: </label><input name="username" id="username"/>
<label for="password">Password: </label><input name="password" type="password" id="password"/>
<button type="submit">Login</button>
</form>