fix(hubspot): align getToken + getEntityDetails with current core contract#94
Merged
Merged
Conversation
…tract getToken reads the OAuth code from params.code (current core passes it unwrapped). getEntityDetails returns the `user` identifier instead of `userId` so core's findOrCreateEntity create-path persists the right key — the lookup path already normalizes user||userId, and getCredentialDetails keeps userId. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d-klotz
force-pushed
the
claude/hubspot-auth-contract-fix
branch
from
June 9, 2026 21:49
fb26907 to
3742e0d
Compare
| requiredAuthMethods: { | ||
| getToken: async function (api, params) { | ||
| const code = get(params.data, 'code'); | ||
| const code = get(params, 'code'); |
There was a problem hiding this comment.
Missing backward compatibility fallback for params.data.code. The PR description promises a fallback for older cores but the code doesn't implement it. This will break integrations using older core versions that pass params.data.code.
Fix:
const code = get(params, 'code') || get(params.data, 'code');
Suggested change
| const code = get(params, 'code'); | |
| const code = get(params, 'code') || get(params.data, 'code'); |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
Contributor
|
🚀 PR was released in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two fixes to
packages/v1-ready/hubspot/definition.jsso the module's auth contract matches the current@friggframework/core:getToken— read the OAuthcodefromparams.code. Current core'sprocess-authorization-callbackcallsgetToken(api, params)and itself readsparams.code; the module was readingparams.data.code, which isundefined.getEntityDetails— return theuseridentifier instead ofuserId. Core'sfindOrCreateEntityspreads the returnedidentifiersstraight into the repository'screateEntity, which keys the entity byuser. The lookup path normalizesuser || userId, but the create path persists whatever key is passed.getCredentialDetailsintentionally stays onuserId(the credential contract).Why
A downstream consumer (a Clockwork↔HubSpot integration) was working around both of these with a local
requiredAuthMethodswrapper aroundhubspot.Definition. With this fix the wrapper is unnecessary.🤖 Generated with Claude Code
Version
Published prerelease version:
@friggframework/api-module-hubspot@2.0.0-next.7Changelog
🐛 Bug Fix
@friggframework/api-module-hubspot@friggframework/api-module-microsoft-teams,@friggframework/api-module-slack,@friggframework/api-module-42matters,@friggframework/api-module-asana,@friggframework/api-module-attio,@friggframework/api-module-clio,@friggframework/api-module-connectwise,@friggframework/api-module-contentful,@friggframework/api-module-contentstack,@friggframework/api-module-crossbeam,@friggframework/api-module-deel,@friggframework/api-module-frigg-scale-test,@friggframework/api-module-frontify,@friggframework/api-module-google-calendar,@friggframework/api-module-google-drive,@friggframework/api-module-helpscout,@friggframework/api-module-hubspot,@friggframework/api-module-ironclad,@friggframework/api-module-linear,@friggframework/api-module-pipedrive,@friggframework/api-module-salesforce,@friggframework/api-module-stripe,@friggframework/api-module-unbabel-projects,@friggframework/api-module-unbabel,@friggframework/api-module-zoho-crm,@friggframework/api-module-zoomafterso it can paginate past page 1 #93 (@d-klotz)Authors: 1