2017-08-24 23:54:02 +02:00
|
|
|
const storage = require('../storage');
|
|
|
|
|
|
|
|
module.exports = async (req, res) => {
|
|
|
|
try {
|
2018-02-06 23:31:18 +01:00
|
|
|
const meta = await storage.metadata(req.params.id);
|
2017-12-21 16:54:19 +01:00
|
|
|
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
|
|
|
|
res.send({
|
2018-02-06 23:31:18 +01:00
|
|
|
password: meta.pwd
|
2017-12-21 16:54:19 +01:00
|
|
|
});
|
2017-08-24 23:54:02 +02:00
|
|
|
} catch (e) {
|
|
|
|
res.sendStatus(404);
|
|
|
|
}
|
|
|
|
};
|