We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa6c785 commit 2958ad6Copy full SHA for 2958ad6
doc/two_factor_authentication.md
@@ -0,0 +1,19 @@
1
+## Two factor authentication
2
+[Back to the navigation](index.md)
3
+
4
5
+### Raising the exception
6
7
+```php
8
+try {
9
+ $authorization = $github->api('authorizations')->create();
10
+} catch (Github\Exception\TwoFactorAuthenticationRequiredException $e {
11
+ echo sprintf("Two factor authentication of type %s is required.", $e->getType());
12
+}
13
+```
14
15
+Once the code has been retrieved (by sms for example), you can create an authorization:
16
17
18
+$authorization = $github->api('authorizations')->create(array('note' => 'Optional'), $code);
19
0 commit comments