1
0
mirror of https://github.com/franjsco/trackmyd-bot synced 2025-06-05 22:19:29 +02:00
Files
trackmyd-bot/auth.js
Francesco Esposito d2148df68c add authentication
2019-02-20 14:31:23 +01:00

16 lines
259 B
JavaScript

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;