How to Bypass Missing China Option and Enable GitHub 2FA Easily
This guide explains why GitHub’s 2FA setup may lack a China option, shows a JavaScript workaround that no longer works, and details the reliable method of completing verification using authenticator apps and a QR code.
Recently, GitHub shows a yellow prompt asking to enable two‑factor authentication (2FA). The user tried to remove it but the country selection list does not include China, making the process impossible.
Some users share a JavaScript snippet that manually adds a “China +86” option to the dropdown:
var option = new Option("China +86","+86");
option.selected = true;
document.getElementById('countrycode').options.add(option, 0);However, this method no longer works for receiving the verification SMS.
Ultimately, the verification was completed using an authentication app. Click the link at the bottom of the page to open the QR code, then scan it with an app such as 1Password, Authy, or Microsoft Authenticator.
After scanning, the app generates a one‑time password that can be entered into the input field at the bottom of the page to finish enabling 2FA.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
