trackmyd-bot/auth.js

16 lines
259 B
JavaScript
Raw Normal View History

2019-02-20 14:31:23 +01:00
const config = require('./config');
function checkUser(userId) {
return config.app.authorizedUsers.includes(userId);
}
function auth(userId, okAuth, koAuth) {
if (checkUser(userId)) {
okAuth();
} else {
koAuth();
}
}
module.exports = auth;