Skip to content

Commit

Permalink
fix: get username from accessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Dec 15, 2020
1 parent 6f0ec24 commit 18dd97d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ async function retrieveUserFields(logger: Logger, username: string): Promise<Use
});

if (sfdc.matchesAccessToken(username)) {
logger.debug('received an accessToken for the username. Converting...');
username = (await connection.identity()).username;
logger.debug(`accessToken converted to ${username}`);
} else {
logger.debug('not a accessToken');
}

const fromFields = Object.keys(REQUIRED_FIELDS).map(upperFirst);
Expand Down

0 comments on commit 18dd97d

Please sign in to comment.