mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: bug where token generation route would fail on null case
This commit is contained in:
@@ -71,6 +71,8 @@ Users.generateToken = async (req, res) => {
|
||||
}
|
||||
|
||||
const settings = await meta.settings.get('core.api');
|
||||
settings.tokens = settings.tokens || [];
|
||||
|
||||
const newToken = {
|
||||
token: utils.generateUUID(),
|
||||
uid: req.user.uid,
|
||||
|
||||
Reference in New Issue
Block a user