diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-10-03 10:04:11 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-10-03 10:04:11 +0300 |
| commit | 2ccc5a2e78f306d3c434c764e34509d4db92d8d8 (patch) | |
| tree | 399f8c061fa698c36d06da9ebc101d65b02df26e /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs | |
| parent | b9e2c008322ce474ce6e0b18da9a786c128de8d9 (diff) | |
| parent | a6496a02892d653a70bc9e0d37856b1a7d3cd74b (diff) | |
| download | Tango-2ccc5a2e78f306d3c434c764e34509d4db92d8d8.tar.gz Tango-2ccc5a2e78f306d3c434c764e34509d4db92d8d8.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
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 | 23 |
1 files changed, 16 insertions, 7 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 2de61fd75..7fe1ae36a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -66,12 +66,19 @@ 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) + public AuthenticationLoginResult Login(string email, string password, bool bypassVersionCheck = false) { var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); _client.Environment = settings.DeploymentSlot; + var appVersion = AssemblyHelper.GetCurrentAssemblyVersion().ToString(); + + if (settings.ForceVersionUpdate) + { + appVersion = "1.0.0.0"; + } + LoginResponse response = null; try @@ -81,7 +88,7 @@ namespace Tango.MachineStudio.UI.Authentication Email = email, Password = password, - Version = AssemblyHelper.GetCurrentAssemblyVersion().ToString(), + Version = appVersion, }).Result; } @@ -90,12 +97,17 @@ namespace Tango.MachineStudio.UI.Authentication throw new AggregateException(new AuthenticationException("Error logging in to machine service."), ex); } + if (bypassVersionCheck) + { + response.VersionChangeRequired = false; + } + if (settings.Environment == MachineStudioSettings.WorkingEnvironment.Remote) { ObservablesContext.OverrideSettingsDataSource(response.DataSource); } - if (response.VersionChangeRequired) + if (response.VersionChangeRequired && !bypassVersionCheck) { return new AuthenticationLoginResult() { @@ -121,10 +133,7 @@ namespace Tango.MachineStudio.UI.Authentication throw new AuthenticationException("Invalid credentials for " + email); } - if (!response.VersionChangeRequired) - { - CurrentUser = user; - } + CurrentUser = user; return new AuthenticationLoginResult() { |
