Implement authentication and access control
This commit is contained in:
1 parent
e1bdcda191
commit
327cb78f1a
27 files changed
+600
-167
No files matched your search
@@ -31,23 +31,33 @@ const component = {
|
||||
};
|
||||
|
||||
taskQueue
|
||||
.commit([task], (deviceId, connectionRequestStatus, tasks2) => {
|
||||
for (let t of tasks2)
|
||||
if (t.status === "stale") taskQueue.deleteTask(t);
|
||||
if (connectionRequestStatus !== "OK")
|
||||
notifications.push(
|
||||
"error",
|
||||
`${deviceId}: ${connectionRequestStatus}`
|
||||
);
|
||||
else if (tasks2[0].status === "stale")
|
||||
notifications.push(
|
||||
"error",
|
||||
`${deviceId}: No contact from device`
|
||||
);
|
||||
else if (tasks2[0].status === "fault")
|
||||
notifications.push("error", `${deviceId}: Refresh faulted`);
|
||||
else notifications.push("success", `${deviceId}: Summoned`);
|
||||
})
|
||||
.commit(
|
||||
[task],
|
||||
(deviceId, err, connectionRequestStatus, tasks2) => {
|
||||
if (err)
|
||||
return notifications.push(
|
||||
"error",
|
||||
`${deviceId}: ${err.message}`
|
||||
);
|
||||
|
||||
for (let t of tasks2)
|
||||
if (t.status === "stale") taskQueue.deleteTask(t);
|
||||
|
||||
if (connectionRequestStatus !== "OK")
|
||||
notifications.push(
|
||||
"error",
|
||||
`${deviceId}: ${connectionRequestStatus}`
|
||||
);
|
||||
else if (tasks2[0].status === "stale")
|
||||
notifications.push(
|
||||
"error",
|
||||
`${deviceId}: No contact from device`
|
||||
);
|
||||
else if (tasks2[0].status === "fault")
|
||||
notifications.push("error", `${deviceId}: Refresh faulted`);
|
||||
else notifications.push("success", `${deviceId}: Summoned`);
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
e.target.disabled = false;
|
||||
store.fulfill(0, Date.now());
|
||||
|
||||
Reference in new issue
Block a user