Hotfixes all the way down

This commit is contained in:
2023-12-24 05:38:27 +11:00
parent 8ab786b934
commit 288e584cbd
5 changed files with 30 additions and 5 deletions
+5 -1
View File
@@ -5,6 +5,7 @@ const { accounts } = require('../database/models');
//middleware
const tokenAuth = require('../utilities/token-auth');
const tokenDecode = require('../utilities/token-decode');
//signup -> validate -> login all without a token
router.post('/signup', require('./signup'));
@@ -20,7 +21,7 @@ router.patch('/reset', require('./password-reset'));
router.delete('/logout', require('./logout'));
//authenticate token
router.use(tokenAuth);
router.use(tokenDecode);
//middleware
router.use(async (req, res, next) => {
@@ -44,6 +45,9 @@ router.use(async (req, res, next) => {
//refresh token
router.post('/token', require('./token'));
//authenticate token
router.use(tokenAuth);
//basic account management (needs a token)
router.get('/account', require('./account-query'));
router.patch('/account', require('./account-update'));