Adds user_id to ExtendedAppointment after authentication

The ExtendedAppointment is passed to the Watcher without user_id, since the user is not yet authenticated.

The Watcher has to add the user_id to the ExtendedAppointment after the user is authenticated.
This commit is contained in:
Sergi Delgado Segura
2020-04-20 13:11:16 +02:00
parent a1b0236c0a
commit 96cb8d4afd

View File

@@ -124,6 +124,8 @@ class Watcher:
raise AppointmentLimitReached(message) raise AppointmentLimitReached(message)
user_id = self.gatekeeper.authenticate_user(appointment.serialize(), signature) user_id = self.gatekeeper.authenticate_user(appointment.serialize(), signature)
# The user_id needs to be added to the ExtendedAppointment once the former has been authenticated
appointment.user_id = user_id
# The uuids are generated as the RIPMED160(locator||user_pubkey). # The uuids are generated as the RIPMED160(locator||user_pubkey).
# If an appointment is requested by the user the uuid can be recomputed and queried straightaway (no maps). # If an appointment is requested by the user the uuid can be recomputed and queried straightaway (no maps).