simple auth
This commit is contained in:
parent
00b274ae92
commit
c3cf83c977
10
auth.js
10
auth.js
|
@ -1,15 +1,7 @@
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
|
|
||||||
function checkUser(userId) {
|
function auth(userId) {
|
||||||
return config.app.authorizedUsers.includes(userId);
|
return config.app.authorizedUsers.includes(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function auth(userId, okAuth, koAuth) {
|
|
||||||
if (checkUser(userId)) {
|
|
||||||
okAuth();
|
|
||||||
} else {
|
|
||||||
koAuth();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = auth;
|
module.exports = auth;
|
||||||
|
|
Loading…
Reference in New Issue