Authentication added. Login/Logout operational.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
@model MileageTraker.Web.ViewModels.LoginViewModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Log in";
|
||||
Layout = "~/Views/Shared/_Layout.login.cshtml";
|
||||
}
|
||||
@section Scripts
|
||||
{
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
@using (Html.BeginForm("Login", "Account", new { ViewBag.ReturnUrl }, FormMethod.Post)) {
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.ValidationSummary(true)
|
||||
|
||||
<fieldset>
|
||||
<legend />
|
||||
@Html.EditorForModel()
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input type="submit" value="Log in" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
@model MileageTraker.Web.ViewModels.ChangePasswordViewModel
|
||||
@{
|
||||
ViewBag.Title = "Manage Account";
|
||||
}
|
||||
|
||||
<hgroup class="title">
|
||||
<h1>@ViewBag.Title</h1>
|
||||
</hgroup>
|
||||
|
||||
<p class="label label-success">@ViewBag.StatusMessage</p>
|
||||
|
||||
<p>You're logged in as <strong>@User.Identity.Name</strong>.</p>
|
||||
|
||||
@Html.Partial("_ChangePasswordPartial")
|
||||
@@ -0,0 +1,33 @@
|
||||
@model MileageTraker.Web.ViewModels.RegisterModel
|
||||
@{
|
||||
ViewBag.Title = "Register";
|
||||
}
|
||||
|
||||
<hgroup class="title">
|
||||
<h1>@ViewBag.Title</h1>
|
||||
<h2>Create a new account.</h2>
|
||||
</hgroup>
|
||||
|
||||
@using (Html.BeginForm()) {
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.ValidationSummary()
|
||||
|
||||
<fieldset>
|
||||
<legend>Registration Form</legend>
|
||||
<ol>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.UserName)
|
||||
@Html.TextBoxFor(m => m.UserName)
|
||||
</li>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.Password)
|
||||
@Html.PasswordFor(m => m.Password)
|
||||
</li>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.ConfirmPassword)
|
||||
@Html.PasswordFor(m => m.ConfirmPassword)
|
||||
</li>
|
||||
</ol>
|
||||
<input type="submit" value="Register" />
|
||||
</fieldset>
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
@model MileageTraker.Web.ViewModels.ChangePasswordViewModel
|
||||
|
||||
<h3>Change password</h3>
|
||||
|
||||
@using (Html.BeginForm("Manage", "Account")) {
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.ValidationSummary()
|
||||
|
||||
<fieldset>
|
||||
<legend>Change Password Form</legend>
|
||||
<ol>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.OldPassword)
|
||||
@Html.PasswordFor(m => m.OldPassword)
|
||||
</li>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.NewPassword)
|
||||
@Html.PasswordFor(m => m.NewPassword)
|
||||
</li>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.ConfirmPassword)
|
||||
@Html.PasswordFor(m => m.ConfirmPassword)
|
||||
</li>
|
||||
</ol>
|
||||
<input type="submit" value="Change password" />
|
||||
</fieldset>
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
@model MileageTraker.Web.ViewModels.ChangePasswordViewModel
|
||||
|
||||
<p>
|
||||
You do not have a password for this site.
|
||||
</p>
|
||||
|
||||
@using (Html.BeginForm("Manage", "Account")) {
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.ValidationSummary()
|
||||
|
||||
<fieldset>
|
||||
<legend>Set Password Form</legend>
|
||||
<ol>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.NewPassword)
|
||||
@Html.PasswordFor(m => m.NewPassword)
|
||||
</li>
|
||||
<li>
|
||||
@Html.LabelFor(m => m.ConfirmPassword)
|
||||
@Html.PasswordFor(m => m.ConfirmPassword)
|
||||
</li>
|
||||
</ol>
|
||||
<input type="submit" value="Set password" />
|
||||
</fieldset>
|
||||
}
|
||||
Reference in New Issue
Block a user