Implement authentication and access control

This commit is contained in:
Zaid Abdulla committed 2018-12-26 00:22:07 -08:00
1 parent e1bdcda191
commit 327cb78f1a
27 files changed
+600 -167

No files matched your search

+27 -17
View File
@@ -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());