All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
Truthfulness is one of the most essential traits of the believer. Truthfulness means saying what conforms to reality. On the other hand, lying is one of the most distinguishing traits of hypocrites. Lying is saying what is contrary to reality. It is prohibited and is never in the nature of the believer. This is the basic principle; and the legal concession that allows lying is confined to a few situations where a valid benefit is guaranteed. Please refer to fataawa 84728 and 88412.
When a person informs another that he agrees with his view while this is not actually true, this is considered a kind of lying and deception. If he told that lie for a valid reason (under Islamic law), then he is excused; otherwise, he bears a sin for it and it is incumbent on him to repent to Allaah. If he has a valid excuse for lying, then he should explain it to the person whom he lied to so that he would understand his excuse and regain his trust.
Allaah knows best.