aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs12
1 files changed, 10 insertions, 2 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 209b26505..0131cd209 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -90,7 +90,7 @@ 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, LoginMethod method, bool bypassVersionCheck = false)
+ public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false, Action<String> logAction = null)
{
_refreshTokenTimer.Stop();
@@ -112,6 +112,8 @@ namespace Tango.MachineStudio.UI.Authentication
try
{
+ logAction?.Invoke("Logging in to machine service...");
+
response = _client.Login(new LoginRequest()
{
@@ -147,7 +149,10 @@ namespace Tango.MachineStudio.UI.Authentication
try
{
- ObservablesStaticCollections.Instance.Initialize();
+ ObservablesStaticCollections.Instance.Initialize((x) =>
+ {
+ logAction.Invoke(x);
+ });
}
catch (Exception ex)
{
@@ -156,6 +161,7 @@ namespace Tango.MachineStudio.UI.Authentication
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
+ logAction.Invoke("Loading user permissions...");
User user = new UserBuilder(db).Set(x => x.Email.ToLower() == email.ToLower()).WithRolesAndPermissions().WithOrganization().Build();
if (user == null)
@@ -167,6 +173,8 @@ namespace Tango.MachineStudio.UI.Authentication
_refreshTokenTimer.Start();
+ logAction.Invoke("Starting application...");
+
return new AuthenticationLoginResult()
{
User = user,