aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-01-24 13:28:53 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-01-24 13:28:53 +0200
commit7fff53b4e158212572dd0d83b5628e799e05ba01 (patch)
tree05932505d589d261515657241d53072af381d108 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
parentecb6665c860f8d7270af9cf8eefaf9ff05e54d62 (diff)
downloadTango-7fff53b4e158212572dd0d83b5628e799e05ba01.tar.gz
Tango-7fff53b4e158212572dd0d83b5628e799e05ba01.zip
Implemented forced environment version in machine studio.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs17
1 files changed, 14 insertions, 3 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 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
/// <param name="password">The password.</param>
/// <returns></returns>
/// <exception cref="AuthenticationException">Login failed for user " + email</exception>
- public User Login(string email, string password)
+ public AuthenticationLoginResult Login(string email, string password)
{
var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
@@ -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
+ };
}
}