question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getAccessTokenFromCode return type

See original GitHub issue

Describe the bug I suspect that getAccessTokenFromCode has incorect return type

To Reproduce Import lib, version 7.0.0, try to call getAccessTokenFromCode, inspect error image

Expected Behavior Types in index.d.ts match actual implementation

Actual Behavior

getAccessTokenFromCode has return type Promise<string> https://github.com/dropbox/dropbox-sdk-js/blob/aac3fee5c0440fd7dc64b1dd064cb783bbf1381c/types/index.d.ts#L44

looking into the implementation of getAccessTokenFromCode I can see it returns parseResponse(res)

https://github.com/dropbox/dropbox-sdk-js/blob/7aa31a0e3b7743537583261522439655132eedbf/src/auth.js#L268-L270

which should return instance of DropboxResponse class https://github.com/dropbox/dropbox-sdk-js/blob/aac3fee5c0440fd7dc64b1dd064cb783bbf1381c/src/response.js#L30

Versions

  • What version of the SDK are you using?
yarn why dropbox
=> Found "dropbox@7.0.0"
  • What version of the language are you using?
yarn why typescript
=> Found "typescript@3.9.5"
  • Are you using Javascript or Typescript? typescript

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
greg-dbcommented, Oct 13, 2020

Thanks for the report! We’ll get these types fixed up.

1reaction
rogebrdcommented, Oct 14, 2020

The PR that I opened mentions a commit to Stone that fixes the return type for all of the auto generated code. I am waiting until that code gets merged so I can run the generator to update all of the types before merging the PR.

That being said, if I missed any of the non-autogenerated return types (anything that isn’t defined in ‘lib’) please let me know and I’ll get that fixed as well!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: dbx.auth not working / getAccessTokenFromCode givi...
Solved: I'm trying to access the `getAccessTokenFromCode` method and I keep receiving a 400 error. On top of that, I can't seem to...
Read more >
Dropbox Node SDK Global
Returns : date of token expiration. Type: Date. getAccessTokenFromCode(redirectUri, code) ... Returns: - code verifier for PKCE. Type: String ...
Read more >
How does the Facebook PHP SDK v5 getAccessToken ...
Takes a valid code from a login redirect, and returns an ... return $this->oAuth2Client->getAccessTokenFromCode($code, $redirectUrl); }.
Read more >
OAuth code flow implementation using Node.JS & Dropbox ...
Choose Dropbox API, App Folder access type, enter a unique name and ... and use the Dropbox JavaScript SDK to exchange the code...
Read more >
Tech note: Dropbox login
refreshTOken = refreshTOken; } return new Dropbox. ... we stored this value before calling Dropbox let cv = localStorage.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found