Skip to content

Commit

Permalink
ci: tweak and simplify setup
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Jun 26, 2024
1 parent 1589fcf commit 1af2a31
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 80 deletions.
6 changes: 3 additions & 3 deletions .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOTENV_PUBLIC_KEY_CI="028df5c697f6fa08aee5d356d77e434b515b099e57dedf9a9ff9489af0

# .env.ci
# ci
BACKEND_DOCKER_HOST="encrypted:BEmbfup2IIE5n6tHsJkT/i3BCcZ+mSnaw8bhIoY5LXFXH91Wa+/+ZxsFHt5+q9rLUu+Pg4GpZ2WSnKQTaqsJrOQW8lYOoo+DuiIC1xbdctICu6yqyWHJTsjCYyRO+iATiU/5QJqdxkJwmTUoUYsagKIvTy+wZYPr7wVckMvwXVv7"
BACKEND_DOCKER_HOST="encrypted:BGjzq31NZI55ZlbrqQyic6MlWm1CnhCnNsShiSAh/Ss8HkI6LIXXwPESLweJACFSX1uNzku+RXsJBzuwL/e6x7zkpfdtW03PdrKZMbDhRs1RjS+EMjgs6sdRj/Y1ja3rmWE0vo20sppfw6ZjL1KhAw=="
BACKEND_HOST="encrypted:BC9NTlvnj/GVd6n8F5ryIFgXYGRya7B7vwX5m0vPz8WePjQih/vzWT1j0+MiTNTuh5O7PGPSEOh/8aqclQrmH0hNdZqqtVD1D5ozt4nkK6tr5xZczgKJBCCqBkMZuVLYWSdOssCUh4y+LnV8/Dg9GUMBfjwVGA=="
FRONTEND_HOST="encrypted:BGSRFIAfMgnrPwMXJ9K94uC/L/RtHbFHjJxx8tTAtJbOxZZprEKPGm8iZ2UdsJX+5y4MnK3gygXcLAQvQrgz5Anb1KD9Szvjpw1tL4OWlCEwQ8sasWLgN4vx7IWY3CiWDpJLC0H8q+ZrEbTPsb8ONsZtQlTvYg=="
KRATOS_PUBLIC_HOST="encrypted:BHfmmvBEWte98hfTZAPQjk6m7dA+qp5IiHWSEHmokBdS3b3U26IiNdzo47XDRJnUVq4kbSr0THa3K0ryrGQMNK36XTqOCzp/+IW3mNC+eJil5eoi3IaFnyCjoXkOy7xKniQZnw1T9CjcHkrMkARjyPsGa3BtYQ=="
Expand All @@ -21,15 +21,15 @@ kratos_log_level="encrypted:BNiD4icxHOWBsViplVnQPh6XN2fQbpubM0Zh7x6RxPWdoeYT/BY7
kratos_selfservice_allowed_return_urls="encrypted:BGgNRINRzIOoYWDnqCEEXWJkjj25ty4mUt+0EsyiIxnTkesXII+5y6ZJVYlmE9Hj7y626yiQMXEcdQYNXZXTlMHYar+a5XL9FtQfZkDlLsjsCgz8P8dCBsJdjo5IqWqSg+ynMegyhlde98BXSlTt59nP+8AdstQSWMFSiCOtFaGu4js1hPZ2lzw="
kratos_selfservice_default_browser_return_url="encrypted:BEGdh5/j7EAIPtUAUEILF8NkP2dDmbMM/R+VxGxGlGJC+iljIvIWuqDBhZYEuCTh39bpt5KxINqchxt+SY2rxisfpcWxLCfxEDhLufS1Dl1LuJFNUuvFsPonrX5UqO8AI+MmH7kJrZ2He0WWdiHFwp1qYVBcevs7Mg=="
kratos_selfservice_flows_errors_ui_url="encrypted:BEyxe92wU3dd0XGq59JIzKpvJ+/Uca2+HLpgPkQhEZtaA2xSbKk4JJIA6J5ynIkLxNTiMGfyg+hirslBBLAEKxiKe0N8zSjL5PNN0GDFa7nvHc6GazUTDqqAxY8OKI0qaxIltR0L/GpubNfzTuWIMvmFeTWv0V/c7uAY9s51"
kratos_selfservice_flows_login_after_hook_config_url="encrypted:BHZXUIGf5kY3HoRoTjM/O/bKHDCZD47tA6iDDncgQsFv1v2WpuUaXeYjP5s42f+T07tzpHwks7b/YcL4KDZCHckxrETqXtC3hTe4BZfWpvlyUVuwU5mWxI6EX5m5BKuFja/DizYOM7r9TTXrkaiaKUbhGXwixv03QSU8OwZhxcP8R5mjLkv2eNcpbMQ="
kratos_selfservice_flows_login_after_hook_config_url="encrypted:BLwNizA5rxG9vb3WVxE8mFHj+ANCrQwW4A9PA6Qjxz9nHioxogWMhbVbn3d7y6SizDALTJr7YriLn3AoULAiBYkC7D05fUV8LayJyBYUXdyeltCHZhWRrAKszNrYsYiYHH4buLBTMC+w9OMtcgSSH4kwRIEh1BsXPB96+uSlPdh9CyAZBQ=="
kratos_selfservice_flows_login_after_hook_config_auth_config_value="encrypted:BPc1xmf3tI0UIbMHe0ACf9rkpkLxML6nsgip6cSUnVDAz+2OhBNAId11X+/42iRrpecuudbA1fJ65Mmw1hR594pg93Gee+ofuFyW67ouPoJWOK0wxszIKCWPX82rEaz+yvhFymNqeWtSk8HX27+/i+DUBUByJw=="
kratos_selfservice_flows_login_after_hook_config_body="encrypted:BJtwl7D5PgE+SPJJTxHdwd5t9vUrpWYx8t89VREJ6GQkBT2/zwmCTHmLG4pw4/wuyhKgGHEK9NYG3iSSfI7ylERhDA7vXNk5weg3EtzKoREPR8viVZhEYKB1ppvKlmQ2MXS4FHIdOumP1uz+tB0S76/+3Y0jkMH9sdmfl2VO3tGPhPS/ajvYeAfmt7J2fJom"
kratos_selfservice_flows_login_after_hook_config_can_interrupt="encrypted:BEk18vkG/8Giedz0n6t0KHF2ourmtOxcu6pcmyWACXgImriqCvUfXl4zHe9pQqodT3zKVFw22YakvDJxdD1i58lPWSoHpy5Tz1flBOG8+MBFcxoahuZt5NkPDmme7lHq3Hco+fk="
kratos_selfservice_flows_login_after_hook_config_response_ignore="encrypted:BBORimJaZavVotLth3+aUFZipk4/BIa4hn0eUmQHJLeyatK8KhKJT3eH6Ipx/+exUXiB55E9TriqGyqwP7a5y3jOJ6Lt8FozQE0nv93awWWuI2xlnKdhdGqByfh5bAePDk8trpgQ"
kratos_selfservice_flows_login_after_hook_config_response_parse="encrypted:BFgKo1Etmfw0wpmxTHD2uHqbu0h3XKbHhY9xjRfWlxPRmbNf/pBZGdqvhUZ2yAHbx3wTRY6xEqe4hqN7FIn9GLTVXTznhl8/UzEEau9mYhoFcBgOghsK8mWcT90vXkjHJ8KAoULE"
kratos_selfservice_flows_login_ui_url="encrypted:BKQKwJdSf99oUdgFj2W5kYc3TWIjJlX50kcpe0eECim+ECooi14eBEPAG9snqJv2RzeeyP1BwIB4zBD5+mfHLY6nGS1j7tzDc3ifOxSAQtC7Ab8rqCxhJ3/Vn/ivTHZ66XZOJx//z7G/+GqcQYyIwAiKYxEjFcsfRh5rUW7Q"
kratos_selfservice_flows_recovery_ui_url="encrypted:BKLqTZ4O0yuoNtVJiVmGXl0OE2eh6ayxZqFMIzSqIIjViyTfiZIdx6VRqtn5/CvQqJiucnJKpwFtEusv/CT5XiDRVw/XzOE9ikSCbn1pNez1sMl2FdFKW4MdXi5I3buQtc3KijJFwFMEKhXqIopI738koQ65JfxwdjSMw+bFpk7Y"
kratos_selfservice_flows_registration_after_hook_config_url="encrypted:BLUWPtrxigwv0bpoxmzNqMOS5uiawtVFpN0w+kvohz7Au5siY2DWNOhIObUgCRL/1iyRgSZWXQpeRjU4NUIsZD0+xvFSuR9DQTJrmS5Im75z3VSNGIkZEWDx5xZAq9rk2c9OwOcKGUvKb0XuyKjmHDYcQtn235p1Bstkyw2KEakyFk6WMAWE7c0BoBU="
kratos_selfservice_flows_registration_after_hook_config_url="encrypted:BFIcPw/8DHbH+i26sdz2KXWPcoLN4AV1J1/lUqRK29+XjMPjOOTWHOi6platF/iD3TmlRqt6TeZzmLdE8HUModFeDH4FNSaV92QIStAIlKqpYz8BuGGIkBh+WZGo1ryYSpTcxhIJhmTp0POXpvTgYabXe4gS4wcOzJiNLxtwQbWmO3SD+g=="
kratos_selfservice_flows_registration_after_hook_config_auth_config_value="encrypted:BBrcb1/+rOsTb4lIkyMvpH5dDSCvkslWh/WJUwcEHBMgqushB3VZpp7ndqX5ghtrIRm0oKmNYiRsDHJA4BmjMFJLRnjJGbPfh+RqEfimAtIGOmCyKtI5nun9pa5eiw6i4Onorf48fPmy67Du4HQr3eIpemeDsQ=="
kratos_selfservice_flows_registration_after_hook_config_body="encrypted:BJhGT0w8wvjTABjmr2C65LgzZN8DxfbWijidFv0poDEqqhsv4c42SyktgbDsQGCjl7NvUoPHBbYpCfHYX0NuLrhO/yzAWNeDI2KpLk7CmVtALXz2R0qH/EsFNBbD31Zcz30n/nhU/UXfoCVQSlpCdjtowCQwOdlgVqRVNT2g1RpDETow/3dwGzFWNq56pxOV"
kratos_selfservice_flows_registration_after_hook_config_can_interrupt="encrypted:BEu+Ic3nnrG8A19DVtYsg0iLr+g5YwSve9qneYCCqxm9TVxsNEnMbJ5hcG0txVRVrF65084t1NcRcclok2TAKr7xrJ2h1si5nSRAxUw6QN6CEgevnr2aKhY1tyf6pQgvUbZ2J/s="
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ env:
DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
POSTGRES_URL: postgres://dbuser:secret@localhost:5432
POSTGRES_DB: cat_fostering_api_e2e
BACKEND_DOCKER_HOST: ${{ vars.BACKEND_DOCKER_HOST || 'http://172.17.0.1:3000' }}
NX_CLOUD_DISTRIBUTED_EXECUTION: ${{ vars.NX_CLOUD_DISTRIBUTED_EXECUTION || 'true' }}

jobs:
Expand Down Expand Up @@ -49,19 +48,15 @@ jobs:
- run: npx nx affected -t lint test build
if: ${{ !env.ACT }}

- run: echo ${{ env.BACKEND_DOCKER_HOST }}

- run: |
npm run ory:generate:kratos -- -e .env.ci
npm run ory:generate:keto -- -e .env.ci
env:
kratos_selfservice_flows_login_after_hook_config_url: ${{ env.BACKEND_DOCKER_HOST }}/api/users/on-sign-in
kratos_selfservice_flows_registration_after_hook_config_url: ${{ env.BACKEND_DOCKER_HOST }}/api/users/on-sign-up
- run: npx nx run cat-fostering-api:docker-build --no-dte

# can't use --wait --wait-timeout N options since Keto and Kratos migrate containers will exit before the Keto and Kratos services are ready
- run: npx @dotenvx/dotenvx run -- docker compose -f docker-compose.yaml -f docker-compose.ci.yaml --profile ci -p cat-fostering up -d
# - run: npx @dotenvx/dotenvx run -- docker compose -f docker-compose.yaml -f docker-compose.ci.yaml --profile ci -p cat-fostering up -d
- run: npx @dotenvx/dotenvx run -- docker compose --profile ci -p cat-fostering up -d

- run: sleep 10

Expand All @@ -79,8 +74,6 @@ jobs:
ORY_KETO_PUBLIC_URL: http://127.0.0.1:4466
API_HOST: 127.0.0.1
API_PORT: 3000
kratos_selfservice_flows_login_after_hook_config_url: ${{ env.BACKEND_DOCKER_HOST }}/api/users/on-sign-in
kratos_selfservice_flows_registration_after_hook_config_url: ${{ env.BACKEND_DOCKER_HOST }}/api/users/on-sign-up

# to enable DTE for split e2e tests, use the following command instead and set stop-agents-after="e2e-ci"
# - run: npx nx affected -t e2e-ci
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ ci: ## Run CI workflow defined in GitHub Actions CI workflow.
@echo 'ℹ️ Prerequisites: https://github.com/cli/cli#installation'
@echo '{"head_commit": {"message": "build latest"}}' >github_event.tmp

# export GITHUB_TOKEN=$(gh auth token)
# export DOTENV_PRIVATE_KEY_CI=$(cat .env.keys | grep DOTENV_PRIVATE_KEY_CI | cut -d '=' -f2 | tr -d '"')
# export GITHUB_TOKEN=$(gh auth token)
# export DOTENV_PRIVATE_KEY_CI=$(cat .env.keys | grep DOTENV_PRIVATE_KEY_CI | cut -d '=' -f2 | tr -d '"')
@act push --container-daemon-socket="unix:///var/run/docker.sock" --bind --env-file='' --var NX_CLOUD_DISTRIBUTED_EXECUTION=false --var BACKEND_DOCKER_HOST="http://api:3000" -s GITHUB_TOKEN="${GITHUB_TOKEN}" -s DOTENV_PRIVATE_KEY_CI=${DOTENV_PRIVATE_KEY_CI} --pull=true -e github_event.tmp --no-cache-server
@rm -f github_event.tmp


ci-clean: ## Clean up containers and volumes created by CI workflow.
@docker compose -f docker-compose.yaml -f docker-compose.ci.yaml --profile ci -p cat-fostering down
@docker compose --profile ci -p cat-fostering down
5 changes: 1 addition & 4 deletions apps/cat-fostering-api-e2e/src/cat-fostering-api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const login = async ({
{ encoding: 'utf-8' }
);
if (stderr) {
console.error(stderr);
throw new Error(stderr);
}
return JSON.parse(stdout.trim());
Expand All @@ -40,14 +39,12 @@ export const register = async ({
email: string;
password: string;
}): Promise<void> => {
const { stdout, stderr } = await execAsync(
const { stderr } = await execAsync(
`npx @getlarge/kratos-cli register --email '${email}' --password '${password}'`,
{ encoding: 'utf-8' }
);

console.log(stdout);
if (stderr) {
console.error(stderr);
throw new Error(stderr);
}
};
Expand Down
17 changes: 6 additions & 11 deletions apps/cat-fostering-api-e2e/src/support/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import {
generateOryKetoConfig,
generateOryKratosConfig,
} from '@cat-fostering/ory-config-generators';
import { execSync } from 'node:child_process';
import { join } from 'node:path';

import { createTestConnection } from './helpers';
import { createTestConnection, restartService } from './helpers';

const applicationEnvPath = join(
__dirname,
'..',
'..',
'..',
'cat-fostering-api/.env.ci'
'cat-fostering-api',
'.env.ci'
);
const dockerEnvPath = join(__dirname, '..', '..', '..', '..', '.env.ci');

Expand All @@ -28,18 +28,13 @@ export default async (): Promise<void> => {
globalThis.__TEARDOWN_MESSAGE__ = __TEARDOWN_MESSAGE__;

generateOryKetoConfig(dockerEnvPath);
execSync('docker compose -p cat-fostering restart keto', {
cwd,
stdio: 'ignore',
});
restartService('keto');

generateOryKratosConfig(dockerEnvPath);
execSync('docker compose -p cat-fostering restart kratos', {
cwd,
stdio: 'ignore',
});
restartService('kratos');

globalThis.__DB_CONNECTION__ = await createTestConnection(applicationEnvPath);
restartService('api');
};

cleanupRegisteredPaths();
13 changes: 3 additions & 10 deletions apps/cat-fostering-api-e2e/src/support/global-teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import {
generateOryKetoConfig,
generateOryKratosConfig,
} from '@cat-fostering/ory-config-generators';
import { execSync } from 'node:child_process';
import { join } from 'node:path';
import { DataSource } from 'typeorm';
import { restartService } from './helpers';

const cwd = process.cwd();
const dockerEnvPath = join(__dirname, '..', '..', '..', '..', '.env');

export default async (): Promise<void> => {
Expand All @@ -21,16 +20,10 @@ export default async (): Promise<void> => {
return;
}
generateOryKetoConfig(dockerEnvPath);
execSync('docker compose -p cat-fostering restart keto', {
cwd,
stdio: 'ignore',
});
restartService('keto');

generateOryKratosConfig(dockerEnvPath);
execSync('docker compose -p cat-fostering restart kratos', {
cwd,
stdio: 'ignore',
});
restartService('kratos');
};

cleanupRegisteredPaths();
14 changes: 13 additions & 1 deletion apps/cat-fostering-api-e2e/src/support/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ import {
UserSchema,
} from '@cat-fostering/entities';
import { config, parse } from 'dotenv';
import { execSync } from 'node:child_process';
import { existsSync, readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { DataSource, DataSourceOptions } from 'typeorm';

const cwd = process.cwd();

const getConnectionOptions = (envFilePath = '.env.test') => {
const variables = existsSync(envFilePath)
? parse(readFileSync(envFilePath))
Expand Down Expand Up @@ -54,7 +57,9 @@ export const createTestConnection = async (envFilePath = '.env.test') => {
const database = urlObject.pathname.replace('/', '');
const username = urlObject.username;
try {
return await new DataSource(options).initialize();
const conn = await new DataSource(options).initialize();
await conn.dropDatabase();
return conn;
} catch (error) {
if (error.message.includes('does not exist')) {
console.warn(`Creating database ${database}...`);
Expand All @@ -73,3 +78,10 @@ export const createTestConnection = async (envFilePath = '.env.test') => {
throw error;
}
};

export const restartService = (service: string): void => {
execSync(`docker compose -p cat-fostering restart ${service}`, {
cwd,
stdio: 'ignore',
});
};
17 changes: 0 additions & 17 deletions docker-compose.ci.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ services:
- ORY_KRATOS_PUBLIC_URL=http://kratos:4433
- PORT=3000
- POSTGRES_URL=postgres://dbuser:secret@postgres:5432
- POSTGRES_DB=${POSTGRES_DB:-appdb}
- POSTGRES_DB=${POSTGRES_DB:-cat_fostering_api_e2e}
networks:
- ory
profiles:
Expand All @@ -75,7 +75,7 @@ services:
kratos-migrate:
image: oryd/kratos:v1.1.0
volumes:
- ./infra/ory-kratos:/etc/config/kratos:ro
- ${PWD}/infra/ory-kratos:/etc/config/kratos:ro
command: -c /etc/config/kratos/kratos.yaml migrate sql -e --yes
restart: on-failure
networks:
Expand All @@ -94,7 +94,7 @@ services:
restart: unless-stopped
command: serve -c /etc/config/kratos/kratos.yaml --dev --watch-courier
volumes:
- ./infra/ory-kratos:/etc/config/kratos:ro
- ${PWD}/infra/ory-kratos:/etc/config/kratos:ro
networks:
- ory
extra_hosts:
Expand Down Expand Up @@ -146,7 +146,7 @@ services:
keto-migrate:
image: oryd/keto:v0.12.0
volumes:
- ./infra/ory-keto:/etc/config/keto:ro
- ${PWD}/infra/ory-keto:/etc/config/keto:ro
command: ['migrate', 'up', '-y', '-c', '/etc/config/keto/keto.yaml']
restart: on-failure
networks:
Expand All @@ -165,7 +165,7 @@ services:
command: serve -c /etc/config/keto/keto.yaml
restart: on-failure
volumes:
- ./infra/ory-keto:/etc/config/keto:ro
- ${PWD}/infra/ory-keto:/etc/config/keto:ro
networks:
- ory
profiles:
Expand Down
1 change: 0 additions & 1 deletion github_event.tmp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function getOryMappings<T extends KeywordMappings>(
): T {
const oldProcessEnv = structuredClone(process.env);
// const keys = Object.keys(plainToInstance(cls, {}));
const result = dotenvX.config({ path: envFilePath, overload: false });
const result = dotenvX.config({ path: envFilePath, overload: true });
process.env = { ...oldProcessEnv };
if (!result.parsed) {
throw new Error(`Unable to parse env file ${envFilePath}`);
Expand Down
4 changes: 4 additions & 0 deletions libs/user/nestjs-module/src/lib/models/ory-webhook.error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { HttpException } from '@nestjs/common';

/**
* @see https://www.ory.sh/docs/kratos/concepts/ui-messages
* @see https://www.ory.sh/docs/kratos/concepts/ui-user-interface
*/
export type OryWebhookErrorMessages = {
instance_ptr?: string;
messages: {
Expand Down
8 changes: 8 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
"jestConfig": "{projectRoot}/jest.config.ts",
"passWithNoTests": true
}
},
"e2e": {
"cache": true,
"inputs": ["default", "^default"],
"options": {
"jestConfig": "{projectRoot}/jest.config.ts",
"runInBand": true
}
}
},
"nxCloudAccessToken": "ZDE5NmQ1N2QtZmZlZS00YTQyLTgzZmMtYzMzYzdiYmQ5YTRmfHJlYWQtd3JpdGU="
Expand Down
34 changes: 26 additions & 8 deletions patches/@getlarge+kratos-cli+0.2.1.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
diff --git a/node_modules/@getlarge/kratos-cli/src/app/login.command.js b/node_modules/@getlarge/kratos-cli/src/app/login.command.js
index b1c9284..e2abc4f 100644
index b1c9284..9b72ea4 100644
--- a/node_modules/@getlarge/kratos-cli/src/app/login.command.js
+++ b/node_modules/@getlarge/kratos-cli/src/app/login.command.js
@@ -60,6 +60,9 @@ let LoginCommand = LoginCommand_1 = class LoginCommand extends nest_commander_1.
@@ -8,6 +8,8 @@ const common_1 = require("@nestjs/common");
const client_1 = require("@ory/client");
const class_validator_1 = require("class-validator");
const nest_commander_1 = require("nest-commander");
+const util = require("util");
+
let LoginQuestions = class LoginQuestions {
parsePassword(val) {
if (!val) {
@@ -60,6 +62,9 @@ let LoginCommand = LoginCommand_1 = class LoginCommand extends nest_commander_1.
identifier: email,
password,
},
+ }).catch((err) => {
+ console.error(err?.error?.response?.data ?? err);
+ process.exit(1);
+ console.error(util.inspect(err?.error?.response?.data ?? err, false, null, true));
+ throw err;
});
this.logger.debug('checking session token:', sessionToken);
const { data } = await this.oryFrontendService.toSession({
diff --git a/node_modules/@getlarge/kratos-cli/src/app/registration.command.js b/node_modules/@getlarge/kratos-cli/src/app/registration.command.js
index 385648f..235ccc2 100644
index 385648f..71c2c98 100644
--- a/node_modules/@getlarge/kratos-cli/src/app/registration.command.js
+++ b/node_modules/@getlarge/kratos-cli/src/app/registration.command.js
@@ -60,6 +60,9 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
@@ -8,6 +8,7 @@ const common_1 = require("@nestjs/common");
const client_1 = require("@ory/client");
const class_validator_1 = require("class-validator");
const nest_commander_1 = require("nest-commander");
+const util = require("util");
let RegistrationQuestions = class RegistrationQuestions {
parsePassword(val) {
if (!val) {
@@ -60,6 +61,10 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
password,
method: 'password',
},
+ }).catch((err) => {
+ console.error(err?.error?.response?.data ?? err);
+ process.exit(1);
+ // this.logger.warn(err.message, util.inspect(err?.error?.response?.data ?? err, false, null, true));
+ console.error(util.inspect(err?.error?.response?.data ?? err, false, null, true));
+ throw err;
});
this.logger.debug(`Registered with email: ${email} and identity.id: ${data.identity.id}`);
console.log(JSON.stringify({
9 changes: 2 additions & 7 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@
"libs/ory-config-generators/src/index.ts"
]
},
"typeRoots": [
"node_modules/@types",
"types"
],
"types": [
"@dotenvx/dotenvx"
],
"typeRoots": ["node_modules/@types", "types"],
"types": ["@dotenvx/dotenvx"]
},
"exclude": ["node_modules", "tmp"]
}

0 comments on commit 1af2a31

Please sign in to comment.