Skip to content

Commit 6da4711

Browse files
committed
improve code
1 parent 4264829 commit 6da4711

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/companion/getKcpToken.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ export async function getKcpToken() {
33
const grantType = 'client_credentials';
44
const clientId =
55
process.env.COMPANION_KCP_AUTH_CLIENT_SECRET ??
6-
(await import('./credentials.js')).credentials.clientId;
6+
(await import('./credentials.js'))?.credentials?.clientId;
77
const clientSecret =
88
process.env.COMPANION_KCP_AUTH_CLIENT_ID ??
9-
(await import('./credentials.js')).credentials.clientSecret;
9+
(await import('./credentials.js'))?.credentials?.clientSecret;
1010

1111
if (!clientId) {
1212
throw new Error('COMPANION_KCP_AUTH_CLIENT_ID is not set');

0 commit comments

Comments
 (0)