diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication')
| -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() { |
