Skip to content

Commit 54043fd

Browse files
authored
Fix usage example in README (#42)
1 parent 44498d5 commit 54043fd

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ const popup = new DropboxPopup({
2525
2. Run the popup window, giving your callback function for use with the `DropboxAuth` object
2626

2727
```
28-
popup.authUser((auth) => {
28+
popup.authUser().then((auth) => {
2929
const dbx = new Dropbox(auth);
30-
}
30+
}).catch((error) => {
31+
console.err(error);
32+
})
3133
```
3234

3335
## Distributions
@@ -41,7 +43,7 @@ npm install --save-dev dropbox-oauth-popup
4143
Or you can use it directly in your browser be including the following tag
4244

4345
```
44-
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@1.4.1"></script>
46+
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@2.0.1"></script>
4547
```
4648

4749
## License

examples/browser.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@7/dist/polyfill.min.js"></script>
66
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.js"></script>
77
<script src="https://cdn.jsdelivr.net/npm/dropbox/dist/Dropbox-sdk.js"></script>
8-
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@2.0.0/dist/dropboxPopup.js"></script>
8+
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@2.0.1/dist/dropboxPopup.js"></script>
99
</head>
1010

1111
<body>
@@ -29,7 +29,7 @@ <h1>Dropbox OAuth Popup Window</h1>
2929
});
3030
function runAuth() {
3131
document.getElementById("result").innerHTML = "Waiting for auth...";
32-
popup.authUser((auth) => {
32+
popup.authUser().then((auth) => {
3333
const dbx = new Dropbox.Dropbox(auth);
3434
dbx.usersGetCurrentAccount()
3535
.then((response) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dropbox-oauth-popup",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"registry": "npm",
55
"description": "This is a simple addition built onto the Dropbox SDK that allows for OAuth in the browser to be done via a popup window.",
66
"homepage": "https://github.com/rogebrd/dropbox-oauth-popup",

0 commit comments

Comments
 (0)