Skip to content

Commit

Permalink
Merge pull request #864 from sbwalker/master
Browse files Browse the repository at this point in the history
resolve Login UI issue #794
  • Loading branch information
sbwalker authored Nov 4, 2020
2 parents f5b99bf + 23a35cf commit 6726a42
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Oqtane.Client/Modules/Admin/Login/Index.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Admin.Login
@namespace Oqtane.Modules.Admin.Login
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
Expand All @@ -16,14 +16,14 @@
<ModuleMessage Message="You Are Already Logged In" Type="MessageType.Info" />
</Authorized>
<NotAuthorized>
<div class="container">
<div class="container Oqtane-Modules-Admin-Login">
<div class="form-group">
<label for="Username" class="control-label">Username: </label>
<input type="text" name="Username" class="form-control" placeholder="Username" @bind="@_username" id="Username" />
<input type="text" name="Username" class="form-control username" placeholder="Username" @bind="@_username" id="Username" />
</div>
<div class="form-group">
<label for="Password" class="control-label">Password: </label>
<input type="password" name="Password" class="form-control" placeholder="Password" @bind="@_password" id="Password" />
<input type="password" name="Password" class="form-control password" placeholder="Password" @bind="@_password" id="Password" />
</div>
<div class="form-group">
<div class="form-check form-check-inline">
Expand All @@ -49,18 +49,23 @@

public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;

public override List<Resource> Resources => new List<Resource>()
{
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" }
};

protected override async Task OnInitializedAsync()
{
if (PageState.QueryString.ContainsKey("returnurl"))
{
_returnUrl = PageState.QueryString["returnurl"];
}

if (PageState.QueryString.ContainsKey("name"))
{
_username = PageState.QueryString["name"];
}

if (PageState.QueryString.ContainsKey("token"))
{
var user = new User();
Expand Down Expand Up @@ -90,7 +95,7 @@
user.Username = _username;
user.Password = _password;
user = await UserService.LoginUserAsync(user, false, false);

if (user.IsAuthenticated)
{
await logger.LogInformation("Login Successful For Username {Username}", _username);
Expand Down Expand Up @@ -154,7 +159,7 @@
{
_message = "Please Enter The Username Related To Your Account And Then Select The Forgot Password Option Again";
}

StateHasChanged();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* Login Module Custom Styles */

.Oqtane-Modules-Admin-Login .username {
width: 200px;
}

.Oqtane-Modules-Admin-Login .password {
width: 200px;
}

0 comments on commit 6726a42

Please sign in to comment.