If there are legal implications, you should continue working but to the minimum required level. But if there are no financial losses or legal implications, you should leave them and break the contract.

I want to leave my job since I know now that it is haram, but i have a contract with them.

Psychological and Social Problems |