diff --git a/backend/src/controllers/auth.controller.ts b/backend/src/controllers/auth.controller.ts index 924f21d..e8754c6 100644 --- a/backend/src/controllers/auth.controller.ts +++ b/backend/src/controllers/auth.controller.ts @@ -1,11 +1,11 @@ import bcrypt from 'bcryptjs'; -import bigInt from 'big-integer'; +//import bigInt from 'big-integer'; import { sign, verify } from 'jsonwebtoken'; import type { EmailOptions } from '../types/email'; import { templateResetPassword } from '../email/email.registry'; import { compileTemplate } from '../email/email.renderer'; import * as auth_service from '../services/auth.service'; -import * as banned_service from '../services/banned.service'; +//import * as banned_service from '../services/banned.service'; import * as email_service from '../services/email.service'; import * as registration_service from '../services/registration.service'; import * as role_service from '../services/role.service'; @@ -58,27 +58,28 @@ export const handlecasticket: AppRequestHandler = async const CASuser = await auth_service.validateCASTicket(ticket); if (CASuser && CASuser.email && CASuser.givenName && CASuser.sn) { - // Assurez-vous que user.email est un string - let user = await user_service.getUserByEmail(CASuser.email.toLowerCase()); - if (!user) { - const isBanned = await banned_service.getBannedByEmail(CASuser.email); - - if (isBanned) { - Unauthorized(res, { msg: 'Unauthorized: user email prohibited' }); - } - - const password = bigInt.randBetween(bigInt(2).pow(255), bigInt(2).pow(256).minus(1)).toString(); - await user_service.createUser( - CASuser.givenName, - CASuser.sn, - CASuser.email, - true, - 'Student', - ' ', - password, - ); - user = await user_service.getUserByEmail(CASuser.email.toLowerCase()); - } + // TEMPORAIRE POUR BLOQUER LA CREATION DE COMPTES NOUVEAUX + // remettre user en let + const user = await user_service.getUserByEmail(CASuser.email.toLowerCase()); + // if (!user) { + // const isBanned = await banned_service.getBannedByEmail(CASuser.email); + // + // if (isBanned) { + // Unauthorized(res, { msg: 'Unauthorized: user email prohibited' }); + // } + // + // const password = bigInt.randBetween(bigInt(2).pow(255), bigInt(2).pow(256).minus(1)).toString(); + // await user_service.createUser( + // CASuser.givenName, + // CASuser.sn, + // CASuser.email, + // true, + // 'Student', + // ' ', + // password, + // ); + // user = await user_service.getUserByEmail(CASuser.email.toLowerCase()); + // } const id = user?.id; diff --git a/backend/src/services/permanence.service.ts b/backend/src/services/permanence.service.ts index 6f182db..e60ac05 100644 --- a/backend/src/services/permanence.service.ts +++ b/backend/src/services/permanence.service.ts @@ -652,19 +652,19 @@ export const sendNotifications = async (notifications: Notification[]) => { permBeginDate: new Intl.DateTimeFormat('fr-FR', { day: '2-digit', month: 'long', - }).format(notification.permanence.start_at), + }).format(new Date(notification.permanence.start_at.getTime() + 2 * 3600000)), permBeginHour: new Intl.DateTimeFormat('fr-FR', { hour: '2-digit', minute: '2-digit', - }).format(notification.permanence.start_at), + }).format(new Date(notification.permanence.start_at.getTime() + 2 * 3600000)), permEndDate: new Intl.DateTimeFormat('fr-FR', { day: '2-digit', month: 'long', - }).format(notification.permanence.end_at), + }).format(new Date(notification.permanence.end_at.getTime() + 2 * 3600000)), permEndHour: new Intl.DateTimeFormat('fr-FR', { hour: '2-digit', minute: '2-digit', - }).format(notification.permanence.end_at), + }).format(new Date(notification.permanence.end_at.getTime() + 2 * 3600000)), permLocation: notification.permanence.location, permDescription: notification.permanence.description, }; @@ -701,13 +701,13 @@ export const sendConcurrentPermanenceNotifications = async (notifications: Concu month: 'long', hour: '2-digit', minute: '2-digit', - }).format(permanence.start_at), + }).format(new Date(permanence.start_at.getTime() + 2 * 3600000)), endAt: new Intl.DateTimeFormat('fr-FR', { day: '2-digit', month: 'long', hour: '2-digit', minute: '2-digit', - }).format(permanence.end_at), + }).format(new Date(permanence.end_at.getTime() + 2 * 3600000)), location: permanence.location, })), }; diff --git a/frontend/src/components/WEI_SDI_Food/foodSection.tsx b/frontend/src/components/WEI_SDI_Food/foodSection.tsx index f8aa861..33ed8ec 100644 --- a/frontend/src/components/WEI_SDI_Food/foodSection.tsx +++ b/frontend/src/components/WEI_SDI_Food/foodSection.tsx @@ -100,13 +100,13 @@ export const FoodSection = () => { ) : ( <> -
+ {/*