diff --git a/twake/backend/node/src/services/console/clients/remote.ts b/twake/backend/node/src/services/console/clients/remote.ts index 78db34b1..c5c2a29e 100644 --- a/twake/backend/node/src/services/console/clients/remote.ts +++ b/twake/backend/node/src/services/console/clients/remote.ts @@ -37,16 +37,17 @@ export class ConsoleRemoteClient implements ConsoleServiceClient { issuer: this.infos.issuer?.replace(/\/+$/, ""), jwksUri: this.infos.jwks_uri, // For local deployment create a https agent that ignore self signed certificate + // eslint-disable-next-line @typescript-eslint/no-var-requires requestAgent: new (require("https").Agent)({ rejectUnauthorized: this.infos.issuer.includes("example.com") ? false : true, }), }); } fetchCompanyInfo(consoleCompanyCode: string): Promise { - throw new Error("Method not implemented."); + throw new Error(`Method not implemented, ${consoleCompanyCode}.`); } resendVerificationEmail(email: string): Promise { - throw new Error("Method not implemented."); + throw new Error(`Method not implemented, ${email}.`); } private auth() { @@ -57,6 +58,7 @@ export class ConsoleRemoteClient implements ConsoleServiceClient { company: ConsoleCompany, user: CreateConsoleUser, ): Promise { + logger.info(`Method not implemented, ${company.id}, ${user.id}.`); return null; } @@ -65,22 +67,26 @@ export class ConsoleRemoteClient implements ConsoleServiceClient { user: UpdateConsoleUserRole, ): Promise { logger.info("Remote: updateUserRole"); + logger.info(`Method not implemented, ${company.id}, ${user.id}.`); return null; } async createCompany(company: CreateConsoleCompany): Promise { logger.info("Remote: createCompany"); + logger.info(`Method not implemented, ${company}.`); return null; } // eslint-disable-next-line @typescript-eslint/no-unused-vars addUserToTwake(user: CreateConsoleUser): Promise { logger.info("Remote: addUserToTwake"); + logger.info(`Method not implemented, ${user}.`); //should do noting for real console return Promise.resolve(undefined); } async updateLocalCompanyFromConsole(partialCompanyDTO: ConsoleHookCompany): Promise { + logger.info(`Method not implemented, ${partialCompanyDTO}.`); return null; } @@ -95,6 +101,9 @@ export class ConsoleRemoteClient implements ConsoleServiceClient { role => role.applications === undefined || role.applications.find(a => a.code === "twake"), ); + //REMOVE LATER + logger.info(`Roles are: ${roles}.`); + let user = await gr.services.users.getByConsoleId(userDTO.email); if (!user) { diff --git a/twake/backend/node/src/services/console/web/controller.ts b/twake/backend/node/src/services/console/web/controller.ts index 2fdbc35b..c38ea1a8 100644 --- a/twake/backend/node/src/services/console/web/controller.ts +++ b/twake/backend/node/src/services/console/web/controller.ts @@ -238,7 +238,7 @@ export class ConsoleController { private async userUpdated(code: string) { //Not implemented yet - throw CrudException.notImplemented("Unimplemented"); + throw CrudException.notImplemented(`Method not implemented, ${code}.`); } private async companyRemoved(content: ConsoleHookCompanyDeletedContent) { diff --git a/twake/backend/node/src/services/console/web/routes.ts b/twake/backend/node/src/services/console/web/routes.ts index 6fc96220..7edcd1b2 100644 --- a/twake/backend/node/src/services/console/web/routes.ts +++ b/twake/backend/node/src/services/console/web/routes.ts @@ -12,7 +12,7 @@ const routes: FastifyPluginCallback = (fastify: FastifyInstance, options, next) const accessControl = async ( request: FastifyRequest<{ Body: ConsoleHookBody; Querystring: ConsoleHookQueryString }>, ) => { - throw fastify.httpErrors.notImplemented("Hook service doesn't exist anymore"); + throw fastify.httpErrors.notImplemented(`Hook service doesn't exist anymore, ${request}.`); }; fastify.route({