mail on mac keep asking password after two factor function is enabled.

mail on mac keep asking password after two factor function is enabled.

hi every one, 
i have enabled two factor function. and get app code for mail on mac then i enter app code to mail account on my mac. 
but after all steps are done, mail on mac keep asking me to enter password. 
this time, both app code and my password are not work. 
only disable two factor function make mail on mac working normal. 

do any one have any solution for this matter? 
thank you for your support.