Skip to content

Commit

Permalink
Merge pull request #2 from farbenmeer/fix/read-data-of-undefined
Browse files Browse the repository at this point in the history
fix: can not read `data` of undefined
  • Loading branch information
noramass committed Jun 7, 2023
2 parents b23ec10 + b972d93 commit cf0664e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: can not read `data` of undefined",
"packageName": "@farbenmeer/deadbolt",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion packages/deadbolt/src/oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function oauth2<Data>({ plugins = [], providers, config: initialConfig }:
await refreshIfNecessary(context);
if (!context.provider) return undefined;
await hooks.retrieveData(context);
if (!context.connected[context.provider.name].data) await context.provider.loadData?.(context);
if (!context.connected[context.provider.name]?.data) await context.provider.loadData?.(context);
return context.connected[providerName];
}

Expand Down

0 comments on commit cf0664e

Please sign in to comment.