Skip to content

Commit

Permalink
Closes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldisaro committed Nov 26, 2020
1 parent 7f99df2 commit 4e08e20
Show file tree
Hide file tree
Showing 62 changed files with 39,544 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Authentication.Pages.Login
@{
await Html.RenderPartialAsync("_AuthenticationForm", Model.AuthenticationForm);
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Login</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_AuthenticationForm", Model.AuthenticationForm);
}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public Login(IBodyGuardAuthenticationApiService authenticationApiService)
[BindProperty]
public AuthenticationForm AuthenticationForm { get; set; }

public void OnGet()
public void OnGet(string returnUrl)
{

AuthenticationForm = new AuthenticationForm();
}

public async Task<IActionResult> OnPost()
Expand All @@ -32,7 +32,7 @@ public async Task<IActionResult> OnPost()
return RedirectToPage(AuthenticationForm.LoginFailurePage,
new {Area = AuthenticationForm.LoginFailureArea});
}

var response = await _authenticationApiService.Login
(AuthenticationForm.LoginRequest.EmailAddress, AuthenticationForm.LoginRequest.Password);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Authentication.Pages.Logout
@{
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<p>Logout executed!</p>
</div>
</div>
</div>

<p>Logout executed!</p>
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Authentication.Pages.PasswordRecovery
@{
await Html.RenderPartialAsync("_PasswordRecoveryForm", Model.PasswordRecoveryForm);
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Password Recovery</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_PasswordRecoveryForm", Model.PasswordRecoveryForm);
}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public PasswordRecovery(IBodyGuardAuthenticationApiService authenticationApiServ

public void OnGet()
{

PasswordRecoveryForm = new PasswordRecoveryForm();
}

public async Task<IActionResult> OnPost()
Expand All @@ -33,7 +33,7 @@ public async Task<IActionResult> OnPost()
return RedirectToPage(PasswordRecoveryForm.FailurePage,
new {Area = PasswordRecoveryForm.FailureArea});
}

var response = await _authenticationApiService.PasswordRecovery
(PasswordRecoveryForm.PasswordRecoveryRequest.EmailAddress,
PasswordRecoveryForm.PasswordRecoveryRequest.TtlSeconds,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Authentication.Pages.Registration
@{
await Html.RenderPartialAsync("_RegistrationForm", Model.RegistrationForm);
}
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Registration</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_RegistrationForm", Model.RegistrationForm);
}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ public Registration(IBodyGuardAuthenticationApiService authenticationApiService)

public void OnGet()
{

RegistrationForm = new RegistrationForm
{
SuccessArea = "Authentication",
SuccessPage = "/Success",
FailureArea = "Authentication",
FailurePage = "/Registration",
SubmitLabel = "Registrati",
CreateRequest = new UserCreateRequest {UserData = new Common.Models.User()}
};
}

public async Task<IActionResult> OnPost()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Authentication.Pages.ValidateRecovery
@{
await Html.RenderPartialAsync("_ValidateRecoveryForm", Model.ValidateRecoveryForm);
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Validate Password Recovery</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_ValidateRecoveryForm", Model.ValidateRecoveryForm);
}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Authorization.Pages.ManageRoles
@{
await Html.RenderPartialAsync("_ManageRolesForm", Model.ManageRolesForm);
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Manage Roles</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_ManageRolesForm", Model.ManageRolesForm);
}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ManageRoles(IBodyGuardAuthorizationApiService authorizationApiService)

public void OnGet()
{

ManageRolesForm = new ManageRolesForm();
}

public async Task<IActionResult> OnPostAssign()
Expand Down
13 changes: 11 additions & 2 deletions Michaelsoft.BodyGuard.Client/Areas/Result/Pages/Failure.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Result.Pages.Failure
@{
Layout = "_BodyGuardLayout";
}

<h4>Failure</h4>
<partial name="_Message" for="Message"/>
<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Failure</h1>
<partial name="_Message" for="Message"/>
</div>
</div>
</div>
13 changes: 11 additions & 2 deletions Michaelsoft.BodyGuard.Client/Areas/Result/Pages/Success.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.Result.Pages.Success
@{
Layout = "_BodyGuardLayout";
}

<h4>Success</h4>
<partial name="_Message" for="Message"/>
<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Success</h1>
<partial name="_Message" for="Message"/>
</div>
</div>
</div>
18 changes: 15 additions & 3 deletions Michaelsoft.BodyGuard.Client/Areas/User/Pages/Delete.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.User.Pages.Delete

@{
await Html.RenderPartialAsync("_DeleteForm", Model.DeleteForm);
}
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Delete User</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_DeleteForm", Model.DeleteForm);
}
</div>
</div>
</div>
</div>
16 changes: 13 additions & 3 deletions Michaelsoft.BodyGuard.Client/Areas/User/Pages/List.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
@page
@using Michaelsoft.BodyGuard.Client.Models.Lists
@model Michaelsoft.BodyGuard.Client.Areas.User.Pages.List

@{
await Html.RenderPartialAsync("_UserList", new UserList());
}
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>User List</h1>
@{
await Html.RenderPartialAsync("_UserList", new UserList());
}
</div>
</div>
</div>
18 changes: 15 additions & 3 deletions Michaelsoft.BodyGuard.Client/Areas/User/Pages/Update.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
@page
@model Michaelsoft.BodyGuard.Client.Areas.User.Pages.Update

@{
await Html.RenderPartialAsync("_UpdateForm", Model.UpdateForm);
}
Layout = "_BodyGuardLayout";
}

<div class="body-guard_client-form_outer">
<div class="body-guard_client-form_middle">
<div class="body-guard_client-form_inner">
<h1>Update User</h1>
<div class="body-guard_client-form_container">
@{
await Html.RenderPartialAsync("_UpdateForm", Model.UpdateForm);
}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Update(IBodyGuardUserApiService userApiService)

public void OnGet(string id)
{

UpdateForm = new UpdateForm();
}

public async Task<IActionResult> OnPost()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Michaelsoft.BodyGuard.Client.Utilities;
using System.Threading;
using Michaelsoft.BodyGuard.Client.Utilities;
using Michaelsoft.BodyGuard.Common.BaseClasses;
using Microsoft.AspNetCore.Builder;

Expand All @@ -10,6 +11,7 @@ public static class ApplicationBuilderExtension
public static void AddBodyGuard(this IApplicationBuilder app)
{
InjectableServicesBaseStaticClass.Services = app.ApplicationServices;
Thread.Sleep(5000); //Sleep to allow server to come up
BodyGuardConfigurationUtility.ConfigureCommonSettings();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
<ProjectReference Include="..\Michaelsoft.BodyGuard.Common\Michaelsoft.BodyGuard.Common.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="wwwroot\**\*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public class AuthenticationForm

public string LoginLabel { get; set; } = "Login";

public string LogoutSuccessArea { get; set; }
public string LogoutSuccessArea { get; set; } = "Authentication";

public string LogoutSuccessPage { get; set; }
public string LogoutSuccessPage { get; set; } = "/Login";

public string LogoutFailureArea { get; set; }
public string LogoutFailureArea { get; set; } = "Authentication";

public string LogoutFailurePage { get; set; }
public string LogoutFailurePage { get; set; } = "/Logout";

public string LogoutLabel { get; set; } = "Logout";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<label asp-for="LoginRequest.EmailAddress"></label>
</div>
<div class="bodyguard_form-input">
<input type="text" asp-for="LoginRequest.EmailAddress"/>
<input type="text" class="form-control" asp-for="LoginRequest.EmailAddress"/>
</div>
<div class="bodyguard_form-error">
<span asp-validation-for="LoginRequest.EmailAddress" class="text-danger"></span>
Expand All @@ -31,14 +31,14 @@
<label asp-for="LoginRequest.Password"></label>
</div>
<div class="bodyguard_form-input">
<input type="password" asp-for="LoginRequest.Password"/>
<input type="password" class="form-control" asp-for="LoginRequest.Password"/>
</div>
<div class="bodyguard_form-error">
<span asp-validation-for="LoginRequest.Password" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">@Model.LoginLabel</button>
<button type="submit" class="btn btn-primary btn-sm btn-block">@Model.LoginLabel</button>
</div>
</div>
</form>
Expand All @@ -64,7 +64,7 @@ else
<input type="hidden" asp-for="LogoutLabel">
<div class="form-group">
<label>@Model.UserMessage @nick</label>
<button type="submit" class="btn btn-primary">@Model.LogoutLabel</button>
<button type="submit" class="btn btn-primary btn-sm btn-block">@Model.LogoutLabel</button>
</div>
</div>
</form>
Expand Down
Loading

0 comments on commit 4e08e20

Please sign in to comment.