Adds exception handling for the BackOfficeUserStore - this will occur if the external OAuth provider doesn't return the Email or Name correctly, then an exception is swallowed at the service level and the user is not actually created, but the BackOfficeUserStore could not detect this, so it's detecting this now.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Security;
|
||||
@@ -97,6 +99,8 @@ namespace Umbraco.Core.Security
|
||||
}
|
||||
_userService.Save(member);
|
||||
|
||||
if (member.Id == 0) throw new DataException("Could not create the user, check logs for details");
|
||||
|
||||
//re-assign id
|
||||
user.Id = member.Id;
|
||||
|
||||
|
||||
@@ -549,6 +549,9 @@ namespace Umbraco.Web.Editors
|
||||
else
|
||||
{
|
||||
|
||||
if (loginInfo.Email.IsNullOrWhiteSpace()) throw new InvalidOperationException("The Email value cannot be null");
|
||||
if (loginInfo.ExternalIdentity.Name.IsNullOrWhiteSpace()) throw new InvalidOperationException("The Name value cannot be null");
|
||||
|
||||
var autoLinkUser = new BackOfficeIdentityUser()
|
||||
{
|
||||
Email = loginInfo.Email,
|
||||
|
||||
Reference in New Issue
Block a user