Skip to content

Commit

Permalink
Hotfix OAuth handler crashing (#208)
Browse files Browse the repository at this point in the history
* use optional chaining

* changeset
  • Loading branch information
taranvohra authored Aug 9, 2023
1 parent 1dc91ae commit 0768f10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-seahorses-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/runtime': patch
---

Fix OAuth handler crashing due lack of optional chaining use while reading spaceInstallation
4 changes: 2 additions & 2 deletions packages/runtime/src/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export function createOAuthHandler(
'state',
JSON.stringify({
installationId: environment.installation.id,
...(environment.spaceInstallation.space
? { spaceId: environment.spaceInstallation.space }
...(environment.spaceInstallation?.space
? { spaceId: environment.spaceInstallation?.space }
: {}),
})
);
Expand Down

0 comments on commit 0768f10

Please sign in to comment.