Skip to content

Commit eab1d22

Browse files
authored
Merge pull request #169 from ungdev/dev
Quick fix : Permanences + CAS
2 parents db79e6d + a6bb834 commit eab1d22

3 files changed

Lines changed: 32 additions & 31 deletions

File tree

‎backend/src/controllers/auth.controller.ts‎

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import bcrypt from 'bcryptjs';
2-
import bigInt from 'big-integer';
2+
//import bigInt from 'big-integer';
33
import { sign, verify } from 'jsonwebtoken';
44
import type { EmailOptions } from '../types/email';
55
import { templateResetPassword } from '../email/email.registry';
66
import { compileTemplate } from '../email/email.renderer';
77
import * as auth_service from '../services/auth.service';
8-
import * as banned_service from '../services/banned.service';
8+
//import * as banned_service from '../services/banned.service';
99
import * as email_service from '../services/email.service';
1010
import * as registration_service from '../services/registration.service';
1111
import * as role_service from '../services/role.service';
@@ -58,27 +58,28 @@ export const handlecasticket: AppRequestHandler<unknown, CasTicketQuery> = async
5858
const CASuser = await auth_service.validateCASTicket(ticket);
5959

6060
if (CASuser && CASuser.email && CASuser.givenName && CASuser.sn) {
61-
// Assurez-vous que user.email est un string
62-
let user = await user_service.getUserByEmail(CASuser.email.toLowerCase());
63-
if (!user) {
64-
const isBanned = await banned_service.getBannedByEmail(CASuser.email);
65-
66-
if (isBanned) {
67-
Unauthorized(res, { msg: 'Unauthorized: user email prohibited' });
68-
}
69-
70-
const password = bigInt.randBetween(bigInt(2).pow(255), bigInt(2).pow(256).minus(1)).toString();
71-
await user_service.createUser(
72-
CASuser.givenName,
73-
CASuser.sn,
74-
CASuser.email,
75-
true,
76-
'Student',
77-
' ',
78-
password,
79-
);
80-
user = await user_service.getUserByEmail(CASuser.email.toLowerCase());
81-
}
61+
// TEMPORAIRE POUR BLOQUER LA CREATION DE COMPTES NOUVEAUX
62+
// remettre user en let
63+
const user = await user_service.getUserByEmail(CASuser.email.toLowerCase());
64+
// if (!user) {
65+
// const isBanned = await banned_service.getBannedByEmail(CASuser.email);
66+
//
67+
// if (isBanned) {
68+
// Unauthorized(res, { msg: 'Unauthorized: user email prohibited' });
69+
// }
70+
//
71+
// const password = bigInt.randBetween(bigInt(2).pow(255), bigInt(2).pow(256).minus(1)).toString();
72+
// await user_service.createUser(
73+
// CASuser.givenName,
74+
// CASuser.sn,
75+
// CASuser.email,
76+
// true,
77+
// 'Student',
78+
// ' ',
79+
// password,
80+
// );
81+
// user = await user_service.getUserByEmail(CASuser.email.toLowerCase());
82+
// }
8283

8384
const id = user?.id;
8485

‎backend/src/services/permanence.service.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,19 +652,19 @@ export const sendNotifications = async (notifications: Notification[]) => {
652652
permBeginDate: new Intl.DateTimeFormat('fr-FR', {
653653
day: '2-digit',
654654
month: 'long',
655-
}).format(notification.permanence.start_at),
655+
}).format(new Date(notification.permanence.start_at.getTime() + 2 * 3600000)),
656656
permBeginHour: new Intl.DateTimeFormat('fr-FR', {
657657
hour: '2-digit',
658658
minute: '2-digit',
659-
}).format(notification.permanence.start_at),
659+
}).format(new Date(notification.permanence.start_at.getTime() + 2 * 3600000)),
660660
permEndDate: new Intl.DateTimeFormat('fr-FR', {
661661
day: '2-digit',
662662
month: 'long',
663-
}).format(notification.permanence.end_at),
663+
}).format(new Date(notification.permanence.end_at.getTime() + 2 * 3600000)),
664664
permEndHour: new Intl.DateTimeFormat('fr-FR', {
665665
hour: '2-digit',
666666
minute: '2-digit',
667-
}).format(notification.permanence.end_at),
667+
}).format(new Date(notification.permanence.end_at.getTime() + 2 * 3600000)),
668668
permLocation: notification.permanence.location,
669669
permDescription: notification.permanence.description,
670670
};
@@ -701,13 +701,13 @@ export const sendConcurrentPermanenceNotifications = async (notifications: Concu
701701
month: 'long',
702702
hour: '2-digit',
703703
minute: '2-digit',
704-
}).format(permanence.start_at),
704+
}).format(new Date(permanence.start_at.getTime() + 2 * 3600000)),
705705
endAt: new Intl.DateTimeFormat('fr-FR', {
706706
day: '2-digit',
707707
month: 'long',
708708
hour: '2-digit',
709709
minute: '2-digit',
710-
}).format(permanence.end_at),
710+
}).format(new Date(permanence.end_at.getTime() + 2 * 3600000)),
711711
location: permanence.location,
712712
})),
713713
};

‎frontend/src/components/WEI_SDI_Food/foodSection.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ export const FoodSection = () => {
100100
</div>
101101
) : (
102102
<>
103-
<div className="surface-card overflow-hidden">
103+
{/* <div className="surface-card overflow-hidden">
104104
<iframe
105105
title="Billetterie Repas"
106106
src="https://www.billetweb.fr/repas-nouveaux-newcomer-dinner"
107107
className="w-full h-[600px] border-none mb-4"
108108
/>
109-
</div>
109+
</div> */}
110110
<div className="surface-card overflow-hidden">
111111
<iframe
112112
title="Billetterie Repas"

0 commit comments

Comments
 (0)