You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING CHANGE: `createBasicAuth()` is no longer exported. Basic Auth support for GitHubs API has been removed. You can find the legacy authentication strategy at https://github.com/octokit/auth-basic.js
@@ -36,7 +35,6 @@ Load `@octokit/auth` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
36
35
```html
37
36
<scripttype="module">
38
37
import {
39
-
createBasicAuth,
40
38
createAppAuth,
41
39
createOAuthAppAuth,
42
40
createTokenAuth,
@@ -53,15 +51,13 @@ Install with <code>npm install @octokit/auth</code>
53
51
54
52
```js
55
53
const {
56
-
createBasicAuth,
57
54
createAppAuth,
58
55
createOAuthAppAuth,
59
56
createTokenAuth,
60
57
createActionAuth,
61
58
} =require("@octokit/auth");
62
59
// or:
63
60
// import {
64
-
// createBasicAuth,
65
61
// createAppAuth,
66
62
// createOAuthAppAuth,
67
63
// createTokenAuth,
@@ -74,12 +70,9 @@ const {
74
70
</table>
75
71
76
72
```js
77
-
constauth=createBasicAuth({
78
-
username:"monatheoctocat",
79
-
password:"secret",
80
-
on2Fa() {
81
-
returnprompt("Two-factor authentication Code:");
82
-
},
73
+
constauth=createAppAuth({
74
+
appId:12345,
75
+
privateKey:"...",
83
76
});
84
77
```
85
78
@@ -88,7 +81,7 @@ Each function exported by `@octokit/auth` returns an async `auth` function.
88
81
The `auth` function resolves with an authentication object. If multiple authentication types are supported, a `type` parameter can be passed.
89
82
90
83
```js
91
-
const { token } =awaitauth({ type:"token" });
84
+
const { token } =awaitauth({ type:"app" });
92
85
```
93
86
94
87
Additionally, `auth.hook()` can be used to directly hook into [`@octokit/request`](https://github.com/octokit/request.js#readme). If multiple authentication types are supported, the right authentication type will be applied automatically based on the request URL.
0 commit comments