1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-10 21:22:35 +01:00
send/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);
}
};