diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-01-19 12:05:37 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-01-19 12:05:37 +0200 |
| commit | 09d432566f696f0eeb3fce97d2c870cfd1c91f89 (patch) | |
| tree | 5a359c890a2b4eaa354d304e1bc188828d691be9 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs | |
| parent | 13b01cc6e2539dae0063f8cf23909e07982dfbb9 (diff) | |
| download | Tango-09d432566f696f0eeb3fce97d2c870cfd1c91f89.tar.gz Tango-09d432566f696f0eeb3fce97d2c870cfd1c91f89.zip | |
Improved ms logging screen.
Improved ObservableStaticCollection init speed.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs | 12 |
1 files changed, 10 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 209b26505..0131cd209 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -90,7 +90,7 @@ namespace Tango.MachineStudio.UI.Authentication /// <param name="password">The password.</param> /// <returns></returns> /// <exception cref="AuthenticationException">Login failed for user " + email</exception> - public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false) + public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false, Action<String> logAction = null) { _refreshTokenTimer.Stop(); @@ -112,6 +112,8 @@ namespace Tango.MachineStudio.UI.Authentication try { + logAction?.Invoke("Logging in to machine service..."); + response = _client.Login(new LoginRequest() { @@ -147,7 +149,10 @@ namespace Tango.MachineStudio.UI.Authentication try { - ObservablesStaticCollections.Instance.Initialize(); + ObservablesStaticCollections.Instance.Initialize((x) => + { + logAction.Invoke(x); + }); } catch (Exception ex) { @@ -156,6 +161,7 @@ namespace Tango.MachineStudio.UI.Authentication using (ObservablesContext db = ObservablesContext.CreateDefault()) { + logAction.Invoke("Loading user permissions..."); User user = new UserBuilder(db).Set(x => x.Email.ToLower() == email.ToLower()).WithRolesAndPermissions().WithOrganization().Build(); if (user == null) @@ -167,6 +173,8 @@ namespace Tango.MachineStudio.UI.Authentication _refreshTokenTimer.Start(); + logAction.Invoke("Starting application..."); + return new AuthenticationLoginResult() { User = user, |
