Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve Login UI issue #794 #864

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}