Includes nice social buttons, updates styling on login and user panel, updates logic to un-link accounts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user