mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-22 22:40:56 -04:00
Fixed logic errors, removed dev leftovers
Fixed a logic error where a comma was used instead of an or, also removed leftover console.logs from testing. Date picker is now dissabled when don't expire is checked. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
parent
d553c4c4f7
commit
01c71a0242
3 changed files with 9 additions and 5 deletions
|
@ -47,14 +47,16 @@ async function validateAPIKey(key) {
|
|||
|
||||
let index = key.substring(0, key.indexOf("-"));
|
||||
let clear = key.substring(key.indexOf("-") + 1, key.length);
|
||||
console.log(index);
|
||||
console.log(clear);
|
||||
|
||||
let hash = await R.findOne("api_key", " id=? ", [ index ]);
|
||||
|
||||
if (hash === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let current = dayjs();
|
||||
let expiry = dayjs(hash.expires);
|
||||
if (expiry.diff(current) < 0, !hash.active) {
|
||||
if (expiry.diff(current) < 0 || !hash.active) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue