SRP6 testing
This commit is contained in:
@ -6,17 +6,32 @@
|
||||
@if (string.IsNullOrEmpty(Model.AuthToken))
|
||||
{
|
||||
<div id="LoginForm">
|
||||
<form action="?handler=Login" method="post" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="UserEmail">E-mail:</label>
|
||||
<input asp-for="UserEmail" type="text" id="UserEmail" />
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h6>Login</h6>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="UserPassword">Password:</label>
|
||||
<input asp-for="UserPassword" type="password" id="UserPassword">
|
||||
<div class="card-body">
|
||||
<form action="?handler=Login" method="post" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="UserEmail">E-mail:</label>
|
||||
<input asp-for="UserEmail" type="text" id="UserEmail" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="UserPassword">Password:</label>
|
||||
<input asp-for="UserPassword" type="password" id="UserPassword">
|
||||
</div>
|
||||
<input type="submit">
|
||||
@Html.AntiForgeryToken()
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -55,10 +70,14 @@
|
||||
<p class="card-text">@ticket.Description</p>
|
||||
<br>
|
||||
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=1">Rename Character</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=8">Recustomize Character</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=64">Change Faction</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=128">Change Race</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=1">Rename
|
||||
Character</a>
|
||||
<a class="btn active"
|
||||
href="/Account?handler=CharacterAction&guid=@ticket.Id&action=8">Recustomize Character</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=64">Change
|
||||
Faction</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@ticket.Id&action=128">Change
|
||||
Race</a>
|
||||
</div>
|
||||
<div class="card-footer text-muted">
|
||||
<p>Opened @ticket.CreateTime.ToLocalTime()</p>
|
||||
@ -79,10 +98,15 @@
|
||||
<h6>@character.Name</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@character.guid&action=1">Rename Character</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@character.guid&action=8">Recustomize Character</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@character.guid&action=64">Change Faction</a>
|
||||
<a class="btn active" href="/Account?handler=CharacterAction&guid=@character.guid&action=128">Change Race</a>
|
||||
<a class="btn active"
|
||||
href="/Account?handler=CharacterAction&guid=@character.guid&action=1">Rename Character</a>
|
||||
<a class="btn active"
|
||||
href="/Account?handler=CharacterAction&guid=@character.guid&action=8">Recustomize
|
||||
Character</a>
|
||||
<a class="btn active"
|
||||
href="/Account?handler=CharacterAction&guid=@character.guid&action=64">Change Faction</a>
|
||||
<a class="btn active"
|
||||
href="/Account?handler=CharacterAction&guid=@character.guid&action=128">Change Race</a>
|
||||
</div>
|
||||
<div class="card-footer text-muted">
|
||||
<p>Level @character.Level @character.GetRace() @character.GetClass()</p>
|
||||
|
||||
@ -11,7 +11,7 @@ namespace NightmareCoreWeb2.Pages
|
||||
{
|
||||
public class AccountModel : PageModel
|
||||
{
|
||||
public string UserEmail { get; set; }
|
||||
public string UserEmail { get; set; }
|
||||
public string UserPassword { get; set; }
|
||||
public string CharacterListType { get; set; }
|
||||
public string AuthToken { get; set; }
|
||||
@ -88,13 +88,17 @@ namespace NightmareCoreWeb2.Pages
|
||||
|
||||
public void OnPostLogin()
|
||||
{
|
||||
Console.WriteLine("Logging in!");
|
||||
UserEmail = Request.Form["UserEmail"];
|
||||
UserPassword = Request.Form["UserPassword"];
|
||||
Username = UserEmail.Substring(0, UserEmail.IndexOf("@"));
|
||||
AuthToken = Hash($"{Username.ToUpper()}:{UserPassword.ToUpper()}");
|
||||
Account a = new Account(Username);
|
||||
if (a.AuthenticateAccount(UserPassword))
|
||||
{
|
||||
Response.Cookies.Append("Username", Username);
|
||||
Response.Cookies.Append("AuthToken", a.Verifier);
|
||||
}
|
||||
|
||||
Response.Cookies.Append("Username", Username);
|
||||
Response.Cookies.Append("AuthToken", AuthToken);
|
||||
}
|
||||
|
||||
static string Hash(string input)
|
||||
|
||||
Reference in New Issue
Block a user