diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-24 09:49:45 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-24 09:49:45 +0300 |
| commit | 5095a1dd5f65a7659083cae6dfccb34007720ee9 (patch) | |
| tree | 62b46d5b437c0d9236827ec46357dd1b1b18c946 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | 121c706c24da22e48b0e4d4dacc7ade8fef757bb (diff) | |
| parent | c6b1a719bac638a647dc2e4af51ad888c9f5039d (diff) | |
| download | Tango-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')
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> |
