aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
index 27c490c80..70a68918a 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
@@ -66,7 +66,7 @@ namespace Tango.FSE.UI.ViewModels
public String Email
{
get { return _email; }
- set { _email = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ set { _email = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(DisplayEnvironment)); InvalidateRelayCommands(); }
}
private String _password;
@@ -153,6 +153,14 @@ namespace Tango.FSE.UI.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets a value indicating whether to display the environment selection.
+ /// </summary>
+ public bool DisplayEnvironment
+ {
+ get { return Email.IsNotNullOrEmpty() && Email.ToLower().EndsWith("@twine-s.com"); }
+ }
+
#endregion
#region Commands
@@ -288,6 +296,12 @@ namespace Tango.FSE.UI.ViewModels
}
IsFree = false;
+
+ if (!DisplayEnvironment) //Force production environment if not a twine user.
+ {
+ SelectedEnvironment = Services.GatewayService.Environments.SingleOrDefault(x => x.Name == "PROD");
+ }
+
SelectedView = LoginViews.Logging;
var result = await AuthenticationProvider.Login(Email, Password, SelectedEnvironment, (status) => Status = status);