aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-24 09:49:45 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-24 09:49:45 +0300
commit5095a1dd5f65a7659083cae6dfccb34007720ee9 (patch)
tree62b46d5b437c0d9236827ec46357dd1b1b18c946 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent121c706c24da22e48b0e4d4dacc7ade8fef757bb (diff)
parentc6b1a719bac638a647dc2e4af51ad888c9f5039d (diff)
downloadTango-5095a1dd5f65a7659083cae6dfccb34007720ee9.tar.gz
Tango-5095a1dd5f65a7659083cae6dfccb34007720ee9.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs10
2 files changed, 12 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index 2fcf55d27..4e5425138 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -48,7 +48,9 @@ namespace Tango.MachineStudio.UI.Authentication
/// <exception cref="AuthenticationException">Login failed for user " + email</exception>
public User Login(string email, string password)
{
- User user = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == password);
+ String hash = User.GetPasswordHash(password);
+
+ User user = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == hash);
if (user == null)
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
index 786951b06..f2a4f1143 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -86,7 +86,15 @@ namespace Tango.MachineStudio.UI.ViewModels
cryptographer = new Rfc2898Cryptographer();
Email = _settings.LastLoginEmail;
RememberMe = _settings.RememberMe;
- Password = cryptographer.Decrypt(_settings.LastLoginPassword);
+
+ try
+ {
+ Password = cryptographer.Decrypt(_settings.LastLoginPassword);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex);
+ }
}
/// <summary>