Skip to content

Commit

Permalink
Allow resourceId to be passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Oct 13, 2023
1 parent 2be4e00 commit 3e41834
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cdk-core/oauth/oauthIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ export function oauthConnect({
nangoFrontend,
providerName,
integrationId,
resourceId,
}: {
nangoFrontend: NangoFrontend
providerName: string
integrationId: Id['int']
/** Should address the re-connect scenario, but let's see... */
resourceId?: Id['reso']
}): Promise<OauthBaseTypes['connectOutput']> {
return nangoFrontend
.auth(integrationId, makeId('reso', providerName, makeUlid()))
.auth(integrationId, resourceId ?? makeId('reso', providerName, makeUlid()))
.then((r) => oauthBaseSchema.connectOutput.parse(r))
.catch((err) => {
if (isNangoAuthError(err)) {
Expand Down

0 comments on commit 3e41834

Please sign in to comment.