Skip to content
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
8 changes: 7 additions & 1 deletion Knossos.NET/Models/ModMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ public enum ModMemberRole

public class ModMember
{
private string _user = string.Empty;

public ModMemberRole role { get; set; }
public string user { get; set; } = string.Empty;
public string user
{
get { return _user; }
set { _user = value.Trim(); }
}
}
}
16 changes: 12 additions & 4 deletions Knossos.NET/ViewModels/Templates/NebulaLoginViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ internal async void Install()

internal async void LogIn()
{
if (string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(UserPass) || string.IsNullOrWhiteSpace(UserName) || string.IsNullOrWhiteSpace(UserPass))
UserName = UserName?.Trim();
UserPass = UserPass?.Trim();

if (string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(UserPass))
{
await MessageBox.Show(MainWindow.instance!, "Username and password are required fields.", "Login error", MessageBox.MessageBoxButtons.OK);
return;
Expand Down Expand Up @@ -134,8 +137,11 @@ internal void SwitchToLogin()

internal async void Register()
{
if(string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(UserPass) || string.IsNullOrEmpty(UserEmail) ||
string.IsNullOrWhiteSpace(UserName) || string.IsNullOrWhiteSpace(UserPass) || string.IsNullOrWhiteSpace(UserEmail))
UserName = UserName?.Trim();
UserPass = UserPass?.Trim();
UserEmail = UserEmail.Trim();

if(string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(UserPass) || string.IsNullOrEmpty(UserEmail))
{
await MessageBox.Show(MainWindow.instance!, "Username, password and email are all required fields.", "Register error", MessageBox.MessageBoxButtons.OK);
return;
Expand Down Expand Up @@ -165,7 +171,9 @@ internal async void Register()

internal async void Reset()
{
if (string.IsNullOrEmpty(UserName) || string.IsNullOrWhiteSpace(UserName))
UserName = UserName?.Trim();

if (string.IsNullOrEmpty(UserName))
{
await MessageBox.Show(MainWindow.instance!, "Username is a required field.", "Reset password", MessageBox.MessageBoxButtons.OK);
return;
Expand Down