summaryrefslogtreecommitdiff
path: root/activitypub.js
diff options
context:
space:
mode:
authorlowercasename <raphaelkabo@gmail.com>2020-06-12 18:30:42 +0100
committerlowercasename <raphaelkabo@gmail.com>2020-06-12 18:30:42 +0100
commit335103a7f94e94f05b656e0193a30e12790a8d38 (patch)
tree963307a87e9f49a7956eed105ebafaf67aed5071 /activitypub.js
parentef4ba730f296444abe46a092d42e07446d3da70f (diff)
Fixed nanoid generation
Diffstat (limited to 'activitypub.js')
-rw-r--r--activitypub.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/activitypub.js b/activitypub.js
index 8ec2ee5..8272b72 100644
--- a/activitypub.js
+++ b/activitypub.js
@@ -7,8 +7,8 @@ const addToLog = require('./helpers.js').addToLog;
const crypto = require('crypto');
// This alphabet (used to generate all event, group, etc. IDs) is missing '-'
// because ActivityPub doesn't like it in IDs
-const nanoid = require('nanoid/generate');
-const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
+const { customAlphabet } = require('nanoid');
+const nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_', 21);
var moment = require('moment-timezone');
const mongoose = require('mongoose');
const Event = mongoose.model('Event');
@@ -805,7 +805,7 @@ function _handleCreateNoteComment(req, res) {
if (ourEvents.length === 1) {
let eventID = ourEvents[0];
// add comment
- let commentID = nanoid(alphabet, 21);
+ let commentID = nanoid();
// get the actor for the commenter
request({
url: req.body.actor,