Skip to content

Commit 2b6538a

Browse files
authored
Fix return type for GetAccessTokenFromCode (#454)
* Fix return type for GetAccessTokenFromCode - Fix for [#[447](#447)]
1 parent a8e110c commit 2b6538a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

generator/typescript/index.d.tstemplate

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export class DropboxAuth {
4141
* @param redirectUri A URL to redirect the user to after authenticating.
4242
* This must be added to your app through the admin interface.
4343
* @param code An OAuth2 code.
44+
* @returns {Object} An object containing the token and related info (if applicable)
4445
*/
45-
getAccessTokenFromCode(redirectUri: string, code: string): Promise<DropboxResponse<string>>;
46+
getAccessTokenFromCode(redirectUri: string, code: string): Promise<DropboxResponse<object>>;
4647

4748
/**
4849
* Get a URL that can be used to authenticate users for the Dropbox API.

src/auth.js

+1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ export default class DropboxAuth {
234234
* @arg {String} redirectUri - A URL to redirect the user to after
235235
* authenticating. This must be added to your app through the admin interface.
236236
* @arg {String} code - An OAuth2 code.
237+
* @returns {Object} An object containing the token and related info (if applicable)
237238
*/
238239
getAccessTokenFromCode(redirectUri, code) {
239240
const clientId = this.getClientId();

types/index.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export class DropboxAuth {
4141
* @param redirectUri A URL to redirect the user to after authenticating.
4242
* This must be added to your app through the admin interface.
4343
* @param code An OAuth2 code.
44+
* @returns {Object} An object containing the token and related info (if applicable)
4445
*/
45-
getAccessTokenFromCode(redirectUri: string, code: string): Promise<DropboxResponse<string>>;
46+
getAccessTokenFromCode(redirectUri: string, code: string): Promise<DropboxResponse<object>>;
4647

4748
/**
4849
* Get a URL that can be used to authenticate users for the Dropbox API.

0 commit comments

Comments
 (0)