public async Task <OperationResult> AddVkIdentity(RegisterVkModel registerModel) { if (registerModel == null || registerModel.Id == 0 || String.IsNullOrEmpty(registerModel.AccessToken) || !(await CheckVkToken(registerModel))) { return(new OperationResult(OperationResultStatus.Error, "Wrong Vk data")); } var user = await _identityService.GetUserIdentity(this.GetCurrentUserId()); user.VkIdentity = registerModel.GetVkIdentity(); return(await _identityService.UpdateUserIdentity(user)); }
private async Task FillIdentityFields(UserInfo userInfo) { var userIdentity = await _userIdentityService.GetUserIdentity(this.GetCurrentUserId()); userInfo.HasEmail = !string.IsNullOrEmpty(userIdentity.LoginEmail); userInfo.HasVk = userIdentity.VkIdentity != null && userIdentity.VkIdentity.Id > 0; }