Fix potential crash in POST /api/v1/import/orphans if request was made without self-key permissions.

This commit is contained in:
zkldi
2021-12-16 04:09:50 +00:00
parent 00b37e88d9
commit bf68c9dc64
@@ -162,7 +162,7 @@ router.post(
* @name POST /api/v1/import/orphans
*/
router.post("/orphans", RequirePermissions("submit_score"), async (req, res) => {
const userDoc = await GetUserWithIDGuaranteed(req.session.tachi!.user.id);
const userDoc = await GetUserWithIDGuaranteed(req[SYMBOL_TachiAPIAuth].userID!);
logger.info(`User ${FormatUserDoc(userDoc)} forced an orphan sync.`);