Paused autologin for now, pick up later
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -60,18 +60,15 @@ namespace Server_Dashboard {
|
||||
Username = Settings.Default.Username;
|
||||
RememberUser = Settings.Default.RememberMe;
|
||||
}
|
||||
AutoLoginAsync();
|
||||
}
|
||||
|
||||
public ICommand LoginCommand { get; set; }
|
||||
|
||||
private async void LoginAsync(object parameter) {
|
||||
if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
int result = 0;
|
||||
if (RememberUser && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies) && Settings.Default.Password.Length == 6) {
|
||||
result = await Task.Run(() => DatabaseHandler.CheckCookie(Settings.Default.Cookies, Username));
|
||||
}
|
||||
Loading = "Visible";
|
||||
result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure()));
|
||||
int result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure()));
|
||||
Loading = "Hidden";
|
||||
switch (result) {
|
||||
case 0:
|
||||
@@ -123,5 +120,19 @@ namespace Server_Dashboard {
|
||||
}
|
||||
ErrorText = "";
|
||||
}
|
||||
//TODO: Add autologin function that locks the UI untill the user hits the abort button or the login completes
|
||||
/*private async void AutoLoginAsync() {
|
||||
if (Settings.Default.RememberMe && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
|
||||
Loading = "Visible";
|
||||
int result = await Task.Run(() => DatabaseHandler.CheckCookie(Settings.Default.Cookies, Username));
|
||||
Loading = "Hidden";
|
||||
if (result == 1) {
|
||||
DashboardWindow window = new DashboardWindow();
|
||||
window.Show();
|
||||
Close?.Invoke();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,4 @@
|
||||
// Updated by XamlIntelliSenseFileGenerator 05.08.2021 22:10:48
|
||||
#pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC333A5F7B9E8D68E824FFFBFE4539E4AA85365F"
|
||||
#pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC333A5F7B9E8D68E824FFFBFE4539E4AA85365F"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
@@ -48,32 +47,37 @@ namespace Server_Dashboard {
|
||||
/// </summary>
|
||||
public partial class LoginWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 9 "..\..\..\LoginWindow.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal Server_Dashboard.LoginWindow Login;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 130 "..\..\..\LoginWindow.xaml"
|
||||
#line 130 "..\..\..\LoginWindow.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.TextBox UserName;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 174 "..\..\..\LoginWindow.xaml"
|
||||
#line 174 "..\..\..\LoginWindow.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.PasswordBox Password;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 185 "..\..\..\LoginWindow.xaml"
|
||||
#line 185 "..\..\..\LoginWindow.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.TextBlock PasswordHint;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
private bool _contentLoaded;
|
||||
|
||||
@@ -89,11 +93,11 @@ namespace Server_Dashboard {
|
||||
_contentLoaded = true;
|
||||
System.Uri resourceLocater = new System.Uri("/Server Dashboard;component/loginwindow.xaml", System.UriKind.Relative);
|
||||
|
||||
#line 1 "..\..\..\LoginWindow.xaml"
|
||||
#line 1 "..\..\..\LoginWindow.xaml"
|
||||
System.Windows.Application.LoadComponent(this, resourceLocater);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
@@ -110,7 +114,8 @@ namespace Server_Dashboard {
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
||||
switch (connectionId) {
|
||||
switch (connectionId)
|
||||
{
|
||||
case 1:
|
||||
this.Login = ((Server_Dashboard.LoginWindow)(target));
|
||||
return;
|
||||
@@ -126,8 +131,6 @@ namespace Server_Dashboard {
|
||||
}
|
||||
this._contentLoaded = true;
|
||||
}
|
||||
|
||||
internal System.Windows.Window Login;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,5 +16,5 @@ C:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\App.xaml
|
||||
2061472260849
|
||||
Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml;Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml;Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml;Controls\LoadingIndicator\LoadingIndicator.xaml;Controls\ServerModules\ServerModule.xaml;LoginWindow.xaml;Views\DashboardPages\MainDashboardPage.xaml;Views\DashboardWindow.xaml;
|
||||
|
||||
False
|
||||
True
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
C:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\obj\Debug\netcoreapp3.1\GeneratedInternalTypeHelper.g.i.cs
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\App.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\LoadingIndicator\LoadingIndicator.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\ServerModules\ServerModule.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\LoginWindow.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Views\DashboardPages\MainDashboardPage.xaml;;
|
||||
FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Views\DashboardWindow.xaml;;
|
||||
|
||||
Reference in New Issue
Block a user