Skip to content

Commit

Permalink
fix: bug where token generation route would fail on null case
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 28, 2020
1 parent 843aff5 commit 618e098
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controllers/write/users.js
Expand Up @@ -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,
Expand Down

0 comments on commit 618e098

Please sign in to comment.