Przeglądaj źródła

Minor changes

pull/47/head^2
Djordje Djoric 3 lat temu
rodzic
commit
5db454013d
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1
    1
      src/middleware/auth.js

+ 1
- 1
src/middleware/auth.js Wyświetl plik

@@ -23,7 +23,7 @@ const authRole = async (req, res, next) => {

const findUser = await User.findOne({ 'tokens.token': token })
if(!findUser) {
return res.status(404).send('No user has the token provided!')
return res.status(401).send('No user has the token provided!')
}
if(findUser['role'] === Role.Admin) {
console.log('User is admin!')

Ładowanie…
Anuluj
Zapisz