feat: nicer error handling for bad jwt in unsubscribe template

This commit is contained in:
Julian Lam
2022-01-14 15:34:46 -05:00
parent c9fabb0e1d
commit 31ea2266a6
3 changed files with 8 additions and 4 deletions

View File

@@ -149,10 +149,12 @@ settingsController.unsubscribe = async (req, res) => {
}
await doUnsubscribe(payload);
res.render('unsubscribe', {
payload: payload,
payload,
});
} catch (err) {
throw new Error(err);
res.render('unsubscribe', {
error: err.message,
});
}
};