1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 03:40:31 +02:00

Reject unauthenticated users + exponential wait time

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-04-06 22:25:58 +02:00
parent 758f714096
commit ea264fbca6
2 changed files with 6 additions and 2 deletions

View File

@ -47,6 +47,10 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
# Fetch the registration of the current user
user = self.scope['user']
if user.is_anonymous:
# User is not authenticated
await self.close()
return
reg = await Registration.objects.aget(user_id=user.id)
self.registration = reg