Skip to content

Commit 6f23982

Browse files
authored
add organiationId to onSuccess callback (#43)
1 parent d68b633 commit 6f23982

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/authkit-callback-route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function authLoader(options: HandleAuthOptions = {}) {
1919

2020
if (code) {
2121
try {
22-
const { accessToken, refreshToken, user, impersonator, oauthTokens } =
22+
const { accessToken, refreshToken, user, impersonator, oauthTokens, organizationId } =
2323
await getWorkOS().userManagement.authenticateWithCode({
2424
clientId: getConfig('clientId'),
2525
code,
@@ -67,6 +67,7 @@ export function authLoader(options: HandleAuthOptions = {}) {
6767
oauthTokens: oauthTokens ?? null,
6868
refreshToken,
6969
user,
70+
organizationId: organizationId ?? null,
7071
});
7172
}
7273

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface AuthLoaderSuccessData {
2525
oauthTokens: OauthTokens | null;
2626
refreshToken: string;
2727
user: User;
28+
organizationId: string | null;
2829
}
2930

3031
export interface RefreshErrorOptions {

0 commit comments

Comments
 (0)