diff options
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 | 26 |
1 files changed, 3 insertions, 23 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 26938b203..3cc5e8b49 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -90,16 +90,13 @@ 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, Action<String> logAction = null) + public AuthenticationLoginResult Login(string email, string password, bool bypassVersionCheck = false) { _refreshTokenTimer.Stop(); var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); - if (!App.StartupArgs.Contains("-webDebug")) - { - _client.Environment = settings.DeploymentSlot; - } + _client.Environment = settings.DeploymentSlot; var appVersion = AssemblyHelper.GetCurrentAssemblyVersion().ToString(); @@ -112,15 +109,12 @@ namespace Tango.MachineStudio.UI.Authentication try { - logAction?.Invoke("Logging in to machine service..."); - response = _client.Login(new LoginRequest() { Email = email, Password = password, Version = appVersion, - Method = method, }).Result; } @@ -147,20 +141,9 @@ namespace Tango.MachineStudio.UI.Authentication }; } - if (response.PasswordChangeRequired) - { - return new AuthenticationLoginResult() - { - Response = response - }; - } - try { - ObservablesStaticCollections.Instance.Initialize((x) => - { - logAction.Invoke(x); - }); + ObservablesStaticCollections.Instance.Initialize(); } catch (Exception ex) { @@ -169,7 +152,6 @@ 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) @@ -181,8 +163,6 @@ namespace Tango.MachineStudio.UI.Authentication _refreshTokenTimer.Start(); - logAction.Invoke("Starting application..."); - return new AuthenticationLoginResult() { User = user, |
