Skip to content

Commit b8d4b3a

Browse files
committed
docs: @octokit/oauth-login-url has been renamed to @octokit/oauth-authorization-url
1 parent 3f99c60 commit b8d4b3a

File tree

1 file changed

+23
-30
lines changed

1 file changed

+23
-30
lines changed

README.md

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# oauth-login-url.js
1+
# oauth-authorization-url.js
22

33
> Universal library to retrieve GitHub’s identity URL for the OAuth web flow
44
5-
[![@latest](https://img.shields.io/npm/v/@octokit/oauth-login-url.svg)](https://www.npmjs.com/package/@octokit/oauth-login-url)
6-
[![Build Status](https://travis-ci.com/octokit/oauth-login-url.js.svg?branch=master)](https://travis-ci.com/octokit/oauth-login-url.js)
7-
[![Greenkeeper](https://badges.greenkeeper.io/octokit/oauth-login-url.js.svg)](https://greenkeeper.io/)
5+
[![@latest](https://img.shields.io/npm/v/@octokit/oauth-authorization-url.svg)](https://www.npmjs.com/package/@octokit/oauth-authorization-url)
6+
[![Build Status](https://travis-ci.com/octokit/oauth-authorization-url.js.svg?branch=master)](https://travis-ci.com/octokit/oauth-authorization-url.js)
7+
[![Greenkeeper](https://badges.greenkeeper.io/octokit/oauth-authorization-url.js.svg)](https://greenkeeper.io/)
88

99
See [GitHub’s Developer Guide for the OAuth web application flow](https://developer.github.com/enterprise/2.16/apps/building-oauth-apps/authorizing-oauth-apps/#1-request-a-users-github-identity).
1010

@@ -18,11 +18,11 @@ See [GitHub’s Developer Guide for the OAuth web application flow](https://deve
1818
</th>
1919
<td width=100%>
2020

21-
Load `@octokit/oauth-login-url` directly from [cdn.pika.dev](https://cdn.pika.dev)
21+
Load `@octokit/oauth-authorization-url` directly from [cdn.pika.dev](https://cdn.pika.dev)
2222

2323
```html
2424
<script type="module">
25-
import { oauthLoginUrl } from "https://cdn.pika.dev/@octokit/oauth-login-url";
25+
import { oauthLoginUrl } from "https://cdn.pika.dev/@octokit/oauth-authorization-url";
2626
</script>
2727
```
2828

@@ -33,49 +33,42 @@ Load `@octokit/oauth-login-url` directly from [cdn.pika.dev](https://cdn.pika.de
3333
</th>
3434
<td>
3535

36-
Install with <code>npm install @octokit/oauth-login-url</code>
36+
Install with <code>npm install @octokit/oauth-authorization-url</code>
3737

3838
```js
39-
const { oauthLoginUrl } = require("@octokit/oauth-login-url");
40-
// or: import { oauthLoginUrl } from "@octokit/oauth-login-url";
39+
const { oauthLoginUrl } = require("@octokit/oauth-authorization-url");
40+
// or: import { oauthLoginUrl } from "@octokit/oauth-authorization-url";
4141
```
4242

4343
</td></tr>
4444
</tbody>
4545
</table>
4646

4747
```js
48-
const {
49-
url,
50-
clientId,
51-
redirectUri,
52-
login,
53-
scopes,
54-
state
55-
} = oauthLoginUrl({
56-
clientId: '1234567890abcdef1234',
57-
redirectUri: 'https://example.com',
58-
login: 'octocat',
59-
scopes: ['repo', 'admin:org'],
60-
state: 'secret123',
48+
const { url, clientId, redirectUri, login, scopes, state } = oauthLoginUrl({
49+
clientId: "1234567890abcdef1234",
50+
redirectUri: "https://example.com",
51+
login: "octocat",
52+
scopes: ["repo", "admin:org"],
53+
state: "secret123",
6154
log: {
62-
warn (message) {
63-
myLogger.log(message, { level: 'warn' })
55+
warn(message) {
56+
myLogger.log(message, { level: "warn" });
6457
}
6558
}
66-
})
59+
});
6760
```
6861

6962
Override or set default options
7063

7164
```js
7265
const myLogin = login.defaults({
73-
baseUrl: 'https://github.my-enterprise.com',
74-
defaultRedirectUri: 'https://app.my-enterprise.com',
75-
client: '1234567890abcdef1234'
76-
})
66+
baseUrl: "https://github.my-enterprise.com",
67+
defaultRedirectUri: "https://app.my-enterprise.com",
68+
client: "1234567890abcdef1234"
69+
});
7770

78-
location.href = oauthLoginUrl().url
71+
location.href = oauthLoginUrl().url;
7972
```
8073

8174
## Options

0 commit comments

Comments
 (0)