Includes nice social buttons, updates styling on login and user panel, updates logic to un-link accounts

This commit is contained in:
Shannon
2015-02-22 13:29:00 +01:00
parent afa4c7b697
commit d9cf9cee88
10 changed files with 165 additions and 91 deletions

View File

@@ -139,7 +139,7 @@ namespace Umbraco.Web.Editors
/// </remarks>
[WebApi.UmbracoAuthorize]
[SetAngularAntiForgeryTokens]
public async Task<UserDetail> GetCurrentUser()
public UserDetail GetCurrentUser()
{
var user = Services.UserService.GetUserById(UmbracoContext.Security.GetUserId());
var result = Mapper.Map<UserDetail>(user);
@@ -150,15 +150,17 @@ namespace Umbraco.Web.Editors
result.SecondsUntilTimeout = httpContextAttempt.Result.GetRemainingAuthSeconds();
}
//now we need to fill in the user's linked logins, we can't do this in the mapper because it has no access to the
// user manager
var identityUser = await UserManager.FindByIdAsync(user.Id);
result.LinkedLogins = identityUser.Logins.ToDictionary(x => x.LoginProvider, x => x.ProviderKey);
return result;
}
[WebApi.UmbracoAuthorize]
[SetAngularAntiForgeryTokens]
public async Task<Dictionary<string, string>> GetCurrentUserLinkedLogins()
{
var identityUser = await UserManager.FindByIdAsync(UmbracoContext.Security.GetUserId());
return identityUser.Logins.ToDictionary(x => x.LoginProvider, x => x.ProviderKey);
}
private BackOfficeUserManager _userManager;
protected BackOfficeUserManager UserManager

View File

@@ -43,7 +43,6 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "allowedSections")]
public IEnumerable<string> AllowedSections { get; set; }
[DataMember(Name = "linkedLogins")]
public IEnumerable<KeyValuePair<string, string>> LinkedLogins { get; set; }
}
}