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:
Shannon
2016-01-05 11:36:52 +01:00
parent 280573be28
commit 8d2e708d1c
2 changed files with 7 additions and 0 deletions

View File

@@ -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;

View File

@@ -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,