Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage example in README #42

Merged
merged 1 commit into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ const popup = new DropboxPopup({
2. Run the popup window, giving your callback function for use with the `DropboxAuth` object

```
popup.authUser((auth) => {
popup.authUser().then((auth) => {
const dbx = new Dropbox(auth);
}
}).catch((error) => {
console.err(error);
})
```

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

```
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@1.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@2.0.1"></script>
```

## License
Expand Down
4 changes: 2 additions & 2 deletions examples/browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@7/dist/polyfill.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dropbox/dist/Dropbox-sdk.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@2.0.0/dist/dropboxPopup.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@2.0.1/dist/dropboxPopup.js"></script>
</head>

<body>
Expand All @@ -29,7 +29,7 @@ <h1>Dropbox OAuth Popup Window</h1>
});
function runAuth() {
document.getElementById("result").innerHTML = "Waiting for auth...";
popup.authUser((auth) => {
popup.authUser().then((auth) => {
const dbx = new Dropbox.Dropbox(auth);
dbx.usersGetCurrentAccount()
.then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dropbox-oauth-popup",
"version": "2.0.0",
"version": "2.0.1",
"registry": "npm",
"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.",
"homepage": "https://github.com/rogebrd/dropbox-oauth-popup",
Expand Down