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.

Programmer DD
Programmer DD
Programmer DD
How to Bypass Missing China Option and Enable GitHub 2FA Easily

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

SecurityGitHubTwo-Factor Authentication2FAAuthenticator Apps
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.