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 { location } = req.body
const {
event,
coords: {
accuracy,
altitude,
@ -29,6 +30,11 @@ module.exports = function () {
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
if (session.exp) {
const deviceExpKey = `device:${deviceId}:last_exp`

View file

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