getAccessTokenFromCode return type
See original GitHub issueDescribe the bug
I suspect that getAccessTokenFromCode
has incorect return type
To Reproduce
Import lib, version 7.0.0, try to call getAccessTokenFromCode
, inspect error
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)
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:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the report! We’ll get these types fixed up.
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!