simple auth

This commit is contained in:
Francesco Esposito 2019-02-20 17:49:12 +01:00
parent 00b274ae92
commit c3cf83c977
1 changed files with 1 additions and 9 deletions

10
auth.js
View File

@ -1,15 +1,7 @@
const config = require('./config');
function checkUser(userId) {
function auth(userId) {
return config.app.authorizedUsers.includes(userId);
}
function auth(userId, okAuth, koAuth) {
if (checkUser(userId)) {
okAuth();
} else {
koAuth();
}
}
module.exports = auth;