From 7fff53b4e158212572dd0d83b5628e799e05ba01 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 24 Jan 2019 13:28:53 +0200 Subject: Implemented forced environment version in machine studio. --- .../Authentication/DefaultAuthenticationProvider.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs') 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 ccaedb359..9be938fb7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -13,6 +13,8 @@ using System.Data.Entity; using Tango.Transport.Web; using Tango.Settings; using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.StudioApplication; +using Tango.Core.Helpers; namespace Tango.MachineStudio.UI.Authentication { @@ -50,7 +52,7 @@ namespace Tango.MachineStudio.UI.Authentication /// The password. /// /// Login failed for user " + email - public User Login(string email, string password) + public AuthenticationLoginResult Login(string email, string password) { var settings = SettingsManager.Default.GetOrCreate(); @@ -61,6 +63,7 @@ namespace Tango.MachineStudio.UI.Authentication Email = email, Password = password, + Version = AssemblyHelper.GetCurrentAssemblyVersion().ToString(), }).Result; @@ -90,8 +93,16 @@ namespace Tango.MachineStudio.UI.Authentication throw new AuthenticationException("Invalid credentials for " + email); } - CurrentUser = user; - return user; + if (!response.VersionChangeRequired) + { + CurrentUser = user; + } + + return new AuthenticationLoginResult() + { + User = user, + Response = response + }; } } -- cgit v1.3.1