public async Task <ActionResult> Login(string returnUrl, SignInViewModel viewModel)
        {
            var authResult = await _contentRepository
                             .WithModelState(this)
                             .Users()
                             .Authentication()
                             .AuthenticateCredentials(new AuthenticateUserCredentialsQuery()
            {
                Username           = viewModel.Username,
                Password           = viewModel.Password,
                UserAreaCode       = CofoundryAdminUserArea.Code,
                PropertyToValidate = nameof(viewModel.Password)
            })
                             .ExecuteAsync();

            if (!ModelState.IsValid)
            {
                var viewPath = ViewPathFormatter.View(CONTROLLER_NAME, nameof(Login));
                return(View(viewPath, viewModel));
            }

            // Support redirect urls from login
            var redirectUrl = RedirectUrlHelper.GetAndValidateReturnUrl(this);

            if (authResult.User.RequirePasswordChange)
            {
                return(Redirect(_adminRouteLibrary.Auth.ChangePassword(returnUrl)));
            }

            // If no action required, log the user in
            await _contentRepository
            .Users()
            .Authentication()
            .SignInAuthenticatedUserAsync(new SignInAuthenticatedUserCommand()
            {
                UserId       = authResult.User.UserId,
                RememberUser = true
            });

            if (redirectUrl != null)
            {
                return(Redirect(redirectUrl));
            }

            return(await GetLoggedInDefaultRedirectActionAsync());
        }