aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2019-01-24 17:29:39 +0200
committerAvi Levkovich <avi@twine-s.com>2019-01-24 17:29:39 +0200
commit5af9cb60feeda4b1dd781c3358418798d828d086 (patch)
tree10d76fda2812077022d4ba459652f16fd08daafa /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
parentd1807ee5a17bada69c8062d7e218c006fe654a24 (diff)
parent6f56066c9d7bca42857792a43063b7eb5a9f47ef (diff)
downloadTango-5af9cb60feeda4b1dd781c3358418798d828d086.tar.gz
Tango-5af9cb60feeda4b1dd781c3358418798d828d086.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
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
+ };
}
}