Beispiel #1
0
        public async Task <User> UpdateUserPasswordAsync(int userId, byte[] passwordHash, byte[] passwordSalt)
        {
            var existingUser = await _dbContext.Users.FindAsync(userId);

            if (existingUser != null)
            {
                existingUser.PasswordHash = passwordHash;
                existingUser.PasswordSalt = passwordSalt;
                _dbContext.Update(existingUser);
                await _dbContext.SaveChangesAsync();
            }
            return(existingUser);
        }