diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-13 16:12:45 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-13 16:12:45 +0300 |
| commit | 998cc8d4d91a7f85389cd0918f127257576c2c13 (patch) | |
| tree | 368ecd76f09b8ff1c4156a554b799cd231c42119 /Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs | |
| parent | 4490b0a76d4188cb285d62b106e208803ceaa133 (diff) | |
| download | Tango-998cc8d4d91a7f85389cd0918f127257576c2c13.tar.gz Tango-998cc8d4d91a7f85389cd0918f127257576c2c13.zip | |
Logs and comments for PPC.UI !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs index 0bae5a237..4096abc24 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs @@ -53,7 +53,19 @@ namespace Tango.PPC.UI.Authentication public User Login(string email, string password) { String hash = User.GetPasswordHash(password); + + LogManager.Log($"Logging in user {email}..."); CurrentUser = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email && x.Password == hash); + + if (CurrentUser != null) + { + LogManager.Log($"Current user is now: {CurrentUser.Contact.FullName}."); + } + else + { + LogManager.Log("Login failed!"); + } + CurrentUserChanged?.Invoke(this, CurrentUser); return CurrentUser; } @@ -63,6 +75,7 @@ namespace Tango.PPC.UI.Authentication /// </summary> public void LogOut() { + LogManager.Log("Logging out current user."); CurrentUser = null; CurrentUserChanged?.Invoke(this, CurrentUser); NavigationManager.NavigateTo(NavigationView.LoginView); |
