drop.chapril.org-firefoxsend/server/routes/password.js

18 lines
355 B
JavaScript
Raw Normal View History

const storage = require('../storage');
2018-02-06 23:31:18 +01:00
module.exports = function(req, res) {
const id = req.params.id;
2018-01-24 19:23:13 +01:00
const auth = req.body.auth;
if (!auth) {
return res.sendStatus(400);
}
try {
2018-01-24 19:23:13 +01:00
storage.setField(id, 'auth', auth);
2018-02-06 23:31:18 +01:00
storage.setField(id, 'pwd', true);
2018-01-24 19:23:13 +01:00
res.sendStatus(200);
} catch (e) {
return res.sendStatus(404);
}
};