-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oauth URL broken and runtime error with logErrorInstance #460
Conversation
…of logErrorInstance is now fixed
@@ -95,7 +95,7 @@ const authenticateWithOauth = async configData => { | |||
const oauthManager = setupOauth(accountId, configData); | |||
logger.log('Authorizing'); | |||
await authorize(oauthManager); | |||
addOauthToAccountConfig(accountId, oauthManager); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still be doing the portalId parse on line 94?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Yeah we still need to do that. I moved it into setupOauth
because that is where it's needed and it doesn't make sense to do the parsing in authenticateWithOauth
anymore.
Code lgtm 👍 When running hs init locally, I noticed we still have this issue |
Ah yes, that is a separate issue that I have a fix for in another branch. I'll pull that into this branch as it is related. Edit: This has now been fixed in this branch. |
It would be good to have some test coverage if there is time since this is not the most common code path now that personal access keys are the recommended auth flow. |
Thank you for mentioning this! I actually brought this up in a meeting yesterday and didn't add it. I'll work on adding this. Edit: Looking at adding this in a separate PR to the tests repo https://github.com/HubSpot/hubspot-cli-tests. Do we want to eventually move the tests into this repo? |
I'm going to merge this to unblock @alnoorp and add the tests async. |
Description and Context
buildAuthUrl
was not obtaining the correctaccountId
because it was looking forportalId
instead this resulted inundefined
being used in the URL instead of theportalId
logErrorInstance
was wrong and causing a runtime errorWho to Notify
@alnoorp