コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: UserController.cs プロジェクト: Lanayx/RadrugaCloud
        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;
        }