Add storing login token (but not retrieving it)
This commit is contained in:
10
static/js/storage.js
Normal file
10
static/js/storage.js
Normal 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));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user