Store uploader IP address

master
Joe Biellik 5 years ago
parent 7eadbe1d0e
commit 253fe68a65

@ -101,6 +101,7 @@ module.exports = {
const paste = new Paste({
paste: ctx.request.body.paste,
ip: ctx.request.ip,
expiresAt: new Date(Date.now() + (ctx.request.body.expire * 1000))
});

@ -6,6 +6,7 @@ const nanoid = customAlphabet(dictionary.nolookalikes, 8);
const paste = new mongoose.Schema({
_id: { type: String, default: nanoid },
paste: { type: String },
ip: { type: String },
expiresAt: { type: Date, expires: 0 }
}, {
timestamps: true

Loading…
Cancel
Save