dropbox-sdk-js
dropbox-sdk-js copied to clipboard
CheckAndRefreshAccessToken and refreshAccessToken typescript declaration is invalid
Describe the bug checkAndRefreshAccessToken and refreshAccessToken functions return a promise and not void. The consequence is call to this function cannot be blocking and create issue when calling getAccessToken that returns undefined or an obsolete token.
Here is the declaration in types/index.d.ts, we can see comment is correct but declaration not ;-)
/**
* Checks if a token is needed, can be refreshed and if the token is expired.
* If so, attempts to refresh access token
* @returns {Promise<*>}
*/
checkAndRefreshAccessToken(): void;
Expected Behavior Prototype should be
checkAndRefreshAccessToken(): Promise<void>;
refreshAccessToken(): Promise<void>;
Versions Latest version v10.31.0 under typescript backend app (nestjs)
Thanks for the report. I'll ask the team to correct this.
I also have this issue. checkAndRefreshAccessToken
works as expected, but only if I await
it.
Thanks for the note. This is still open with the team.