fix timeout string
All checks were successful
Build and push image for doorman-homeassistant / diff (push) Successful in 10s
Build and push Doorman UI / API / diff (push) Successful in 10s
Build and push image for doorman-homeassistant / docker (push) Has been skipped
Build and push image for doorman-homeassistant / deploy-gitainer (push) Has been skipped
Build and push Doorman UI / API / twilio (push) Successful in 2m40s

This commit is contained in:
Martin Dimitrov 2025-10-29 09:50:59 -07:00
parent 58de01deaf
commit 8a84369fc7

View File

@ -65,14 +65,14 @@ export const handler: ServerlessFunctionSignature<TwilioContext, AuthRequestTwil
getMetricFromRegistry<Counter>(metricsRegistry, AuthMetrics.AUTH_METHOD)
.inc({ method }, 1);
const fingerprint = {
const fingerprint = {
method,
userAgent: event.request.headers['user-agent'],
ip: event.ip,
};
// take timeout from the query string
const timeout = event.timeout || config.timeout;
const timeout = req.timeout || config.timeout;
// check lock status if locked, then unlock. If unlocked then lock
const lock = await db.entities.lockStatus.findById(getLockStatusID(door));
@ -90,7 +90,7 @@ export const handler: ServerlessFunctionSignature<TwilioContext, AuthRequestTwil
} else {
await db.entities.lockStatus.save(createLockStatusWithTimeout(door, timeout, fingerprint));
setResponseJson(response, 200, {
setResponseJson(response, 200, {
msg: `Opened the door "${door}" for ${timeout}s`
});
}