diff options
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); |
