public async Task<IActionResult> Login(string returnUrl)
 {
     var vm = await _loginViewModelBuilder.Build(returnUrl);
     if (vm.IsExternalLoginOnly) // we only have one option for logging in and it's an external provider
     {
         return RedirectToAction(nameof(ExternalController.Challenge), "External", new { provider = vm.ExternalLoginScheme, returnUrl });
     }
     return View(vm);
 }
Example #2
0
        public MainWindowViewModel(IMainViewModelBuilder mainViewModelBuilder,
                                   ILoginViewModelBuilder loginViewModelBuilder,
                                   INotificationServiceContainerViewModel notificationServiceContainerViewModel,
                                   IActionBarViewModel actionBarViewModel,
                                   ISession session,
                                   Action <string> errorCallback)
        {
            this.mainViewModelBuilder = mainViewModelBuilder;
            this.session       = session;
            this.errorCallback = errorCallback;

            NotificationServiceContainerViewModel = notificationServiceContainerViewModel;
            ActionBarViewModel = actionBarViewModel;

            session.ApplicationStateChanged += OnApplicationStateChanged;

            LoginViewModel = loginViewModelBuilder.Build();

            IsMainViewVisible  = false;
            IsLoginViewVisible = true;

            CheckWindowClosing = true;
            CloseWindow        = new Command(DoCloseWindow);
        }