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