Skip to content

Commit

Permalink
Fix refreshSession overloads (#142)
Browse files Browse the repository at this point in the history
* Fix type error

* Don't remove older overrides

* Make typescript happy
  • Loading branch information
PaulAsjes authored Nov 20, 2024
1 parent d10ffce commit 8649e79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@workos-inc/node": "^7.31.0",
"@workos-inc/node": "^7.33.0",
"iron-session": "^8.0.1",
"jose": "^5.2.3",
"path-to-regexp": "^6.2.2"
Expand Down
7 changes: 3 additions & 4 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function updateSession(
refreshToken,
user,
impersonator,
oauthTokens: session.oauthTokens
oauthTokens: session.oauthTokens,
});

newRequestHeaders.set(sessionHeaderName, encryptedSession);
Expand All @@ -168,11 +168,10 @@ async function updateSession(
}
}

async function refreshSession(options?: {
async function refreshSession(options: {
organizationId?: string;
ensureSignedIn: false;
ensureSignedIn?: boolean;
}): Promise<UserInfo | NoUserInfo>;
async function refreshSession(options: { organizationId?: string; ensureSignedIn: true }): Promise<UserInfo>;
async function refreshSession({
organizationId: nextOrganizationId,
ensureSignedIn = false,
Expand Down

0 comments on commit 8649e79

Please sign in to comment.