Javascript code will not send POST request with signature field if it was left unfilled which is correct according to the application logic - this field is optional. However, backend does not treat it as such causing it to be always required.
This leads us to bug where frontend keeps resending the same form without the key but backend rejects it.
In order to solve it the backend should treat signature as an optional field and use it only when it was provided.