Skip to content

Commit

Permalink
appseting test 11
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystianKempski committed Nov 11, 2024
1 parent 3450088 commit cd03d35
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DagoniteEmpire/Areas/Identity/Pages/Account/Login.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<div>
<p>
You can use default test users or create your own account. test 9
You can use default test users or create your own account.
</p>
<b>
Default player account:
Expand Down
63 changes: 34 additions & 29 deletions DagoniteEmpire/Areas/Identity/Pages/Account/Register.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page
@model RegisterModel
@inject IConfiguration _configuration
@using DA_Common;
@{
ViewData["Title"] = "Register";
Expand Down Expand Up @@ -45,37 +46,41 @@
<button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-primary">Register</button>
</form>
</div>
<div class="col-md-6 col-md-offset-2">
<section>
<h3>Try some test accounts.</h3>
<hr />
@if (_configuration.GetConnectionString("TestAccountsEnable") == "true")
{

<div>
<p>
You can use default test users or create your own account.
</p>
<b>
Default player account:
</b>
<p>
- Login: `player@example.com`
</p>
<p>
- Password: `Guest123*`
</p>
<b>
Default Game Master account:
</b>
<p>
- Login: `gm@example.com`
</p>
<p>
- Password: `Guest123*`
</p>
</div>
<div class="col-md-6 col-md-offset-2">
<section>
<h3>Try some test accounts.</h3>
<hr />

</section>
</div>
<div>
<p>
You can use default test users or create your own account.
</p>
<b>
Default player account:
</b>
<p>
- Login: player@example.com
</p>
<p>
- Password: Guest123*
</p>
<b>
Default Game Master account:
</b>
<p>
- Login: gm@example.com
</p>
<p>
- Password: Guest123*
</p>
</div>

</section>
</div>
}

</div>

Expand Down
6 changes: 3 additions & 3 deletions DagoniteEmpire/Service/DbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ IConfiguration configuration
_roleManager = roleManager;
_userManager = userManager;
_mapper = mapper;
_configuration = configuration;
c = configuration;
}
public async Task Initialize()
{
Expand Down Expand Up @@ -71,7 +71,7 @@ public async Task Initialize()
ApplicationUser user = new()
{
UserName = "GameMaster",
Email = "[email protected]",
Email = email,
EmailConfirmed = true,
};

Expand All @@ -80,7 +80,7 @@ public async Task Initialize()
{
throw new Exception("Could not get password from appisetting.json");
}
var res1 = _userManager.CreateAsync(user, "MacierzKara5^&").GetAwaiter().GetResult();
var res1 = _userManager.CreateAsync(user, pass).GetAwaiter().GetResult();
if (res1.Errors.Any())
{
foreach (var err in res1.Errors)
Expand Down

0 comments on commit cd03d35

Please sign in to comment.