Giter VIP home page Giter VIP logo

dropbox-oauth-popup's Introduction

Logo

npm npm jsDelivr hits (npm) GitHub package.json dependency version (prod)

This is a simple addition built onto the Dropbox SDK that allows for OAuth in the browser to be done via a popup window.

You can view our documentation on GitHub Pages.

Usage

  1. Create a new instance of the DropboxPopup class
const popup = new DropboxPopup({
    clientId: 'XXXXXXXXXX',
    clientSecret: 'XXXXXXXXXX',
    redirectUri: 'https://XXXXXXXXXX'
});
  1. Run the popup window, giving your callback function for use with the DropboxAuth object
popup.authUser().then((auth) => {
    const dbx = new Dropbox(auth);
}).catch((error) => {
    console.err(error);
})

Distributions

If you are using this via a node project compiled into browser assets, you can install via npm

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/[email protected]"></script>

License

This package is distributed under the MIT license, please see LICENSE for more information.

dropbox-oauth-popup's People

Contributors

dependabot[bot] avatar rogebrd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

lukewood

dropbox-oauth-popup's Issues

result.expires_in is in wrong js format

Describe the bug
The value returned by dropbox uses unix epoch instead of whatever js format is

To Reproduce
check the value

Expected Behavior
new Date(Date.now() + (result.expires_in * 1000))

Actual Behavior
new Date(Date.now() + (result.expires_in))

Screenshots
If applicable, add screenshots to help explain your problem.

Versions
#54043fd58e6ab36e21fe1c70b00d3b7c98736400

Error

dropbox version 7.1.0
dropbox-oauth-popup : <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Capture d’écran de 2020-10-23 12-30-49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.