fix(sync): event

This commit is contained in:
devthejo 2025-07-27 23:12:23 +02:00
parent a80a5aaa00
commit 42cddb2aa2
No known key found for this signature in database
GPG key ID: 00CCA7A92B1D5351
2 changed files with 7 additions and 1 deletions

View file

@ -13,6 +13,7 @@ module.exports = function () {
const logger = ctx.require("logger") const logger = ctx.require("logger")
const { location } = req.body const { location } = req.body
const { const {
event,
coords: { coords: {
accuracy, accuracy,
altitude, altitude,
@ -29,6 +30,11 @@ module.exports = function () {
const { deviceId } = session const { deviceId } = session
// Log the event type if present
if (event) {
logger.debug({ action: "geoloc-sync-event", deviceId, event })
}
// Check JWT expiration sequence to prevent replay attacks // Check JWT expiration sequence to prevent replay attacks
if (session.exp) { if (session.exp) {
const deviceExpKey = `device:${deviceId}:last_exp` const deviceExpKey = `device:${deviceId}:last_exp`

View file

@ -31,7 +31,7 @@ requestBody:
- geofence - geofence
- geofenceschange - geofenceschange
- enabledchange - enabledchange
- connectvitychange - connectivitychange
- schedule - schedule
- powersavechange - powersavechange
- notificationaction - notificationaction