Display custom login errors (#7734)

Fixes #7588
This commit is contained in:
Julián Alazorza
2017-09-14 21:26:55 +02:00
committed by Sébastien Ros
parent 70adb1833f
commit 8036e539b6
12 changed files with 98 additions and 70 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
using System.Web.Routing;
@@ -55,7 +56,8 @@ namespace Orchard.Media.Services {
XRpcStruct file,
UrlHelper url) {
var user = _membershipService.ValidateUser(userName, password);
List<LocalizedString> validationErrors;
var user = _membershipService.ValidateUser(userName, password, out validationErrors);
if (!_authorizationService.TryCheckAccess(Permissions.ManageMedia, user, null)) {
throw new OrchardCoreException(T("Access denied"));
}