Use consistent length for hub secrets

This commit is contained in:
Christopher Cookman 2025-09-15 10:33:03 -06:00
parent a55dd6c42c
commit 9526c3790b

View file

@ -61,7 +61,7 @@ const opts = { // Map of option number to step number
}, },
5: { 5: {
step: 25, exec: async (hubId, uid) => { step: 25, exec: async (hubId, uid) => {
const newKey = crypto.randomBytes(16).toString('hex'); const newKey = crypto.randomBytes(64).toString('hex');
await pool.query('UPDATE hubs SET secretKey = ? WHERE id = ?', [newKey, hubId]); await pool.query('UPDATE hubs SET secretKey = ? WHERE id = ?', [newKey, hubId]);
return `New secret key generated: ||${newKey}||\n\nType another option number, or \`cancel\` to exit.`; return `New secret key generated: ||${newKey}||\n\nType another option number, or \`cancel\` to exit.`;
} }