feat(database): make token column nullable in caldav_tokens table for improved flexibility
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m36s

This commit is contained in:
2026-03-04 22:24:11 +01:00
parent f16fd9aef2
commit d8c52aae4e
2 changed files with 43 additions and 1 deletions

View File

@@ -752,7 +752,7 @@ router.post('/caldav-tokens', authenticateToken, async (req, res) => {
const tokenHash = crypto.createHash('sha256').update(token).digest('hex');
const result = await db.run(
// Store only the hash — never the plaintext — to limit exposure on DB breach.
'INSERT INTO caldav_tokens (user_id, token, token_hash, name) VALUES (?, NULL, ?, ?)',
'INSERT INTO caldav_tokens (user_id, token_hash, name) VALUES (?, ?, ?)',
[req.user.id, tokenHash, name.trim()],
);
res.status(201).json({