Code Generator is a security feature for your Facebook app used with two-factor authentication. When you turn it on, your phone will generate a special security code that you can use to authenticate your login attempt on another computer or mobile device.
https://www.facebook.com/help/www/270942386330392?helpref=faq_content