Skip to content

Commit b23baa6

Browse files
committed
fix(kernel): narrow static token ambiguity guard
1 parent 376cc0e commit b23baa6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lib/kernel/KernelAuth.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,8 @@ export function buildKernelConnectionOptions(options: ConnectionOptions): Kernel
640640
}
641641

642642
if (authType === 'static-token') {
643-
const { staticToken, token, enableTokenFederation, federationClientId } = options as {
643+
const { staticToken, enableTokenFederation, federationClientId } = options as {
644644
staticToken?: string;
645-
token?: string;
646645
enableTokenFederation?: boolean;
647646
federationClientId?: string;
648647
};
@@ -651,10 +650,10 @@ export function buildKernelConnectionOptions(options: ConnectionOptions): Kernel
651650
"kernel backend: a non-empty token must be supplied via `staticToken` when using `authType: 'static-token'`.",
652651
);
653652
}
654-
if (token !== undefined || oauth.oauthClientId !== undefined || oauth.oauthClientSecret !== undefined) {
653+
if (oauth.oauthClientId !== undefined || oauth.oauthClientSecret !== undefined) {
655654
throw new HiveDriverError(
656-
'kernel backend: cannot supply `staticToken` alongside `token` or ' +
657-
'`oauthClientId`/`oauthClientSecret` on the same connection. Pick one auth mode.',
655+
'kernel backend: cannot supply `staticToken` alongside `oauthClientId`/`oauthClientSecret` ' +
656+
'on the same connection. Pick one auth mode.',
658657
);
659658
}
660659
return {

0 commit comments

Comments
 (0)