Add storing login token (but not retrieving it)

This commit is contained in:
2018-12-17 02:34:46 -08:00
parent 720e6db334
commit 6f1e3da27b
3 changed files with 19 additions and 0 deletions

10
static/js/storage.js Normal file
View File

@@ -0,0 +1,10 @@
function setupStorage(app) {
app.ports.setStoreValuePort.subscribe(function(data) {
key = data[0];
value = data[1];
localStorage.setItem(key, value);
});
app.ports.getStoreValuePort.subscribe(function(data) {
app.ports.receiveStoreValuePort.send(localStorage.getItem(data));
});
}