From 7e31bcf9d67aacff1d87e396a1321eb2c613d859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Mon, 11 Mar 2024 10:24:24 +0100 Subject: [PATCH] add message for when user try to upload file with maliciose script --- src/app/services/auth.service.ts | 2 ++ src/app/services/http-error-handle.service.ts | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 7e382a2f6..497fdc427 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -232,6 +232,7 @@ export class AuthService { window['e'] = e console.error('BeforesendAtachment', e) message.uploadingFile = false + this.httpErroHandle.httpStatusHandleUploadFile(e); return false } @@ -252,6 +253,7 @@ export class AuthService { window['e'] = e console.error('BeforesendAtachment', e) message.uploadingFile = false + this.httpErroHandle.httpStatusHandleUploadFile(e); return false } } diff --git a/src/app/services/http-error-handle.service.ts b/src/app/services/http-error-handle.service.ts index 49b039f1a..d7eb38160 100644 --- a/src/app/services/http-error-handle.service.ts +++ b/src/app/services/http-error-handle.service.ts @@ -50,13 +50,24 @@ export class HttpErrorHandle { } } + async httpStatusHandleUploadFile(error) { + switch (error.status + ) { + case 403: + this.toastService._badRequest('O ficheiro que .') + break; + default: + break; + } + } + async loginHttpStatusHandle(error) { switch (error.status ) { case 0: const result = await this.backgroundService.offline() if (result) { - this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') + this.toastService._badRequest('O ficheiro que tentou enviar contém possível script malicioso') } else { }