Ejemplo n.º 1
0
        public async Task <ProfileResponseModel> PutProfile([FromBody] UpdateProfileRequestModel model)
        {
            await _userService.SaveUserAsync(model.ToUser(_currentContext.User));

            var response = new ProfileResponseModel(_currentContext.User);

            return(response);
        }
Ejemplo n.º 2
0
        public async Task <ProfileResponseModel> PutProfile([FromBody] UpdateProfileRequestModel model)
        {
            var user = await _userService.GetUserByPrincipalAsync(User);

            await _userService.SaveUserAsync(model.ToUser(user));

            var response = new ProfileResponseModel(user, null);

            return(response);
        }
Ejemplo n.º 3
0
        public async Task <ProfileResponseModel> PutProfile([FromBody] UpdateProfileRequestModel model)
        {
            var user = await _userService.GetUserByPrincipalAsync(User);

            if (user == null)
            {
                throw new UnauthorizedAccessException();
            }

            await _userService.SaveUserAsync(model.ToUser(user));

            var response = new ProfileResponseModel(user, null, null, null, await _userService.TwoFactorIsEnabledAsync(user));

            return(response);
        }