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;
|
Username = Settings.Default.Username;
|
||||||
RememberUser = Settings.Default.RememberMe;
|
RememberUser = Settings.Default.RememberMe;
|
||||||
}
|
}
|
||||||
|
AutoLoginAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand LoginCommand { get; set; }
|
public ICommand LoginCommand { get; set; }
|
||||||
|
|
||||||
private async void LoginAsync(object parameter) {
|
private async void LoginAsync(object parameter) {
|
||||||
if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
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";
|
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";
|
Loading = "Hidden";
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -123,5 +120,19 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
ErrorText = "";
|
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>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -48,6 +47,11 @@ namespace Server_Dashboard {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class LoginWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
public partial class LoginWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
||||||
|
|
||||||
|
|
||||||
|
#line 9 "..\..\..\LoginWindow.xaml"
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||||
|
internal Server_Dashboard.LoginWindow Login;
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
@@ -110,7 +114,8 @@ namespace Server_Dashboard {
|
|||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||||
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
||||||
switch (connectionId) {
|
switch (connectionId)
|
||||||
|
{
|
||||||
case 1:
|
case 1:
|
||||||
this.Login = ((Server_Dashboard.LoginWindow)(target));
|
this.Login = ((Server_Dashboard.LoginWindow)(target));
|
||||||
return;
|
return;
|
||||||
@@ -126,8 +131,6 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
this._contentLoaded = true;
|
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
|
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;
|
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