Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Eurus-Holmes/0963e7c01953c5b6253264e06db5b02d to your computer and use it in GitHub Desktop.
Save Eurus-Holmes/0963e7c01953c5b6253264e06db5b02d to your computer and use it in GitHub Desktop.
The problem when Chinese user enabling GitHub two-factor authentication via SMS
今天发现 GitHub 有两步验证的功能,于是打算开启,可是悲剧的是,到了填写手机号的时候,发现没有 China 的选项。
于是我尝试了下修改网页源代码,添加了 `<option value="+86">China +86</option>` 再填手机号,居然就收到短信了。
后来有点不放心,还是给 https://github.com/contact 发了个反馈,然后收到回信说由于某些国家的短信发送成功率无法保证,所以没有开启两步验证功能。
不过在我这段时间的使用过程中,还是挺稳定的,每次都能收到短信。
大家如果也需要开启两步验证,最好把 Recover code 也记下来吧,避免以后短信收不到。
## Massage sent to GitHub Contact
I found that the country code field has no option for Chinese users when I was enabling two-factor authentication via SMS:
```html
<select class="js-country-code-select js-2fa-confirm" autocomplete="tel-country-code" name="countrycode">
...
<option value="+257">Burundi +257</option>
<option value="+855">Cambodia +855</option>
<option value="+1">Canada +1</option>
<option value="+238">Cape Verde +238</option>
<option value="+1345">Cayman Islands +1345</option>
<option value="+61">Christmas Island +61</option>
<option value="+61">Cocos +61</option>
<option value="+243">Congo, Dem Rep +243</option>
<option value="+385">Croatia +385</option>
<option value="+357">Cyprus +357</option>
<option value="+420">Czech Republic +420</option>
<option value="+45">Denmark +45</option>
...
</select>
```
I am wondering if this is a bug?
BTW, I have fixed the problem by adding `<option value="+86">China +86</option>`, and it works because I have received the message from GitHub!
## Email received from GitHub staff
Hi Xcat,
Due to the importance of two factor authentication messages we want to be extremely confident in the delivery rates before we enable one time password delivery via SMS since heavy delays render the one time password useless and being unable to receive one prevents you from accessing your account.
This is the reason that SMS is not presented as an option in some countries. As our provider advises us on the delivery status in specific countries we'll revise the list:
https://help.github.com/articles/countries-where-sms-authentication-is-supported/
Thanks,
James
@wheelcomplex
Copy link

Many thanks, it works with my 136 number :XD

@kmcbest
Copy link

kmcbest commented Aug 23, 2023

这招不灵了,会提示 we've tried to send an SMS, but the number doesn't seem to be correct.
不管了,装微软的APP完成认证了。

@JesseYan
Copy link

不好使了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment