Skip to content

Commit 8ce9a1b

Browse files
authored
fix/error handling (#1590)
Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>
1 parent 928468c commit 8ce9a1b

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

apps/api-gateway/src/oid4vc-issuance/dtos/issuer-sessions.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-mixed-operators */
12
/* eslint-disable @typescript-eslint/explicit-function-return-type */
23
/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/explicit-function-return-type, @typescript-eslint/explicit-module-boundary-types, camelcase */
34
import {

libs/prisma-service/prisma/seed.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -680,17 +680,26 @@ export async function createKeycloakUser(): Promise<void> {
680680
CRYPTO_PRIVATE_KEY
681681
} = process.env;
682682

683-
if (
684-
!KEYCLOAK_DOMAIN ||
685-
!KEYCLOAK_REALM ||
686-
!PLATFORM_ADMIN_KEYCLOAK_ID ||
687-
!PLATFORM_ADMIN_KEYCLOAK_SECRET ||
688-
!CRYPTO_PRIVATE_KEY
689-
) {
690-
throw new Error(
691-
'Missing required environment variables for either PLATFORM_ADMIN_USER_PASSWORD or KEYCLOAK_DOMAIN or KEYCLOAK_REALM or PLATFORM_ADMIN_KEYCLOAK_ID or PLATFORM_ADMIN_KEYCLOAK_SECRET or CRYPTO_PRIVATE_KEY'
692-
);
683+
if (!KEYCLOAK_DOMAIN) {
684+
throw new Error('Missing environment variable: KEYCLOAK_DOMAIN');
685+
}
686+
687+
if (!KEYCLOAK_REALM) {
688+
throw new Error('Missing environment variable: KEYCLOAK_REALM');
689+
}
690+
691+
if (!PLATFORM_ADMIN_KEYCLOAK_ID) {
692+
throw new Error('Missing environment variable: PLATFORM_ADMIN_KEYCLOAK_ID');
693693
}
694+
695+
if (!PLATFORM_ADMIN_KEYCLOAK_SECRET) {
696+
throw new Error('Missing environment variable: PLATFORM_ADMIN_KEYCLOAK_SECRET');
697+
}
698+
699+
if (!CRYPTO_PRIVATE_KEY) {
700+
throw new Error('Missing environment variable: CRYPTO_PRIVATE_KEY');
701+
}
702+
694703
const decryptedPassword = CryptoJS.AES.decrypt(platformAdminData.password, CRYPTO_PRIVATE_KEY);
695704
const token = await getKeycloakToken();
696705
const user = {

0 commit comments

Comments
 (0)