Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Not receiving bearer_token from file chooser #72

Closed
xjcoan opened this issue Apr 8, 2019 · 2 comments
Closed

Not receiving bearer_token from file chooser #72

xjcoan opened this issue Apr 8, 2019 · 2 comments

Comments

@xjcoan
Copy link

xjcoan commented Apr 8, 2019

Hi, I'm looking to receive oauth bearer tokens back after successfully choosing a file location to store documents. I'd like to save this key so I can sue it later when grabbing or saving files from another Kloudless window. I'm able to successfully choose a service, login, etc. but the bearer token seems to be missing from the response on my callback. I've set retrieve_token to true.

The code:

var KloudlessFileChooser = function(domNode) {
  var explorer = window.Kloudless.explorer({
    app_id: MYAPPID,
    multiselect: false,
    computer: false,
    services: ['all'],
    types: ['folders'],
    retrieve_token: true
  });

  explorer.on('success', function(files) {
      // files doesn't contain bearer_token
  };

  explorer.choosify($(domNode)[0]);
};

Without the token, I get an error when attempting to use the file chooser elsewhere in the app: failed to refresh filesystem Error: "Account data empty"

Any help would be greatly appreciated!

@vinodc
Copy link
Member

vinodc commented Apr 8, 2019

Hi! Have you set the domain you are launching the File Explorer from as a Trusted Domain on this page: https://developers.kloudless.com/applications/*/ui-tools/file-explorer?

If you have but the error continues to appear, do you mind sending a note to support@kloudless.com with your Application ID?

@xjcoan
Copy link
Author

xjcoan commented Apr 8, 2019

Yep, that was the issue. Had it pointing to our production URLs, but not to the NGROK instance I was using to test it locally.
Thanks!

@xjcoan xjcoan closed this as completed Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants