From 998cc8d4d91a7f85389cd0918f127257576c2c13 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 13 Aug 2018 16:12:45 +0300 Subject: Logs and comments for PPC.UI ! --- .../Authentication/DefaultAuthenticationProvider.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs') 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 /// public void LogOut() { + LogManager.Log("Logging out current user."); CurrentUser = null; CurrentUserChanged?.Invoke(this, CurrentUser); NavigationManager.NavigateTo(NavigationView.LoginView); -- cgit v1.3.1