diff --git a/src/app/api/idnot/UserController.ts b/src/app/api/idnot/UserController.ts index 3558d13a..54424a04 100644 --- a/src/app/api/idnot/UserController.ts +++ b/src/app/api/idnot/UserController.ts @@ -31,26 +31,17 @@ export default class UserController extends ApiController { @Post("/api/v1/idnot/user/:code") protected async getUserInfosFromIdnot(req: Request, response: Response) { try { - const code = req.params["code"]; - console.log("code", code); - - - + const code = req.params["code"]; if (!code) throw new Error("code is required"); const idNotToken = await this.idNotService.getIdNotToken(code); - console.log("idNotToken", idNotToken); - - if (!idNotToken) { this.httpValidationError(response, "IdNot token undefined"); return; } - const user = await this.idNotService.getOrCreateUser(idNotToken); - console.log("user", user); - + const user = await this.idNotService.getOrCreateUser(idNotToken); if (!user) { this.httpUnauthorized(response, "User not found"); @@ -61,9 +52,7 @@ export default class UserController extends ApiController { //Whitelist feature //Get user with contact - const prismaUser = await this.userService.getByUid(user.uid, { contact: true, role: true, office_membership: true }); - console.log("prismaUser", prismaUser); - + const prismaUser = await this.userService.getByUid(user.uid, { contact: true, role: true, office_membership: true }); if (!prismaUser) { this.httpNotFoundRequest(response, "user not found"); @@ -71,17 +60,13 @@ export default class UserController extends ApiController { } //Hydrate user to be able to use his contact - const userHydrated = User.hydrate(prismaUser, { strategy: "excludeAll" }); - console.log("userHydrated", userHydrated); - + const userHydrated = User.hydrate(prismaUser, { strategy: "excludeAll" }); if (!userHydrated.contact?.email || userHydrated.contact?.email === "") { this.httpUnauthorized(response, "Email not found"); return; } - let isSubscribed = await this.subscriptionsService.isUserSubscribed(user.uid, userHydrated.office_membership?.uid!); - console.log("isSubscribed", isSubscribed); - + let isSubscribed = await this.subscriptionsService.isUserSubscribed(user.uid, userHydrated.office_membership?.uid!); //Check if user is whitelisted // const isWhitelisted = await this.whitelistService.getByEmail(userHydrated.contact!.email); @@ -98,12 +83,10 @@ export default class UserController extends ApiController { await this.idNotService.updateOffice(user.office_uid); const payload = await this.authService.getUserJwtPayload(user.idNot); - console.log("payload", payload); if (!payload) return; if (!isSubscribed && (userHydrated.role?.name === "admin" || userHydrated.role?.name === "super-admin")) { - console.log("userHydrated.role", userHydrated.role); const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { uid: "94343601-04c8-44ef-afb9-3047597528a9" }, @@ -120,9 +103,7 @@ export default class UserController extends ApiController { isSubscribed = true; } - if (!isSubscribed) { - console.log("User not subscribed"); - + if (!isSubscribed) { this.httpUnauthorized(response, "User not subscribed"); return; } diff --git a/src/entries/App.ts b/src/entries/App.ts index 91f3cece..1b207c5c 100644 --- a/src/entries/App.ts +++ b/src/entries/App.ts @@ -14,9 +14,7 @@ const storage = multer.memoryStorage(); (async () => { try { - const variables = await Container.get(BackendVariables).validate(); - console.log(variables); - + const variables = await Container.get(BackendVariables).validate(); const port = variables.APP_PORT; const rootUrl = variables.APP_ROOT_URL; const label = variables.APP_LABEL ?? "Unknown Service"; diff --git a/src/services/common/IdNotService/IdNotService.ts b/src/services/common/IdNotService/IdNotService.ts index a1844173..f18721ad 100644 --- a/src/services/common/IdNotService/IdNotService.ts +++ b/src/services/common/IdNotService/IdNotService.ts @@ -120,22 +120,16 @@ export default class IdNotService extends BaseService { redirect_uri: this.variables.IDNOT_REDIRECT_URL, code: code, grant_type: "authorization_code", - }); - console.log(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query.toString()); - + }); const token = await fetch(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query, { method: "POST" }); - console.log(token); if(token.status !== 200) console.error(await token.text()); const decodedToken = (await token.json()) as IIdNotToken; - console.log(decodedToken); - const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload; - console.log(decodedIdToken); - + const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload; return decodedIdToken; diff --git a/src/services/common/OfficeRibService/OfficeRibService.ts b/src/services/common/OfficeRibService/OfficeRibService.ts index 89134334..dbd4ea25 100644 --- a/src/services/common/OfficeRibService/OfficeRibService.ts +++ b/src/services/common/OfficeRibService/OfficeRibService.ts @@ -38,7 +38,6 @@ export default class OfficerRibService extends BaseService { } public async createOrUpdate(officeId: string, file: Express.Multer.File) { - console.log("officeId", officeId); const key = path.join(this.variables.ENV, officeId, file.originalname); const uploadParams = { @@ -47,7 +46,6 @@ export default class OfficerRibService extends BaseService { Body: file.buffer, // Example: fs.createReadStream('/path/to/file') ACL: "public-read", // Optional: Set the ACL if needed }; - console.log("uploadParams", uploadParams); return new Promise((resolve, reject) => { this.s3.putObject(uploadParams, (err, data) => {