2024-09-27 14:16:11 -04:00
|
|
|
const AuthConfig = require('../config/auth.js');
|
2024-09-22 14:52:41 -04:00
|
|
|
|
|
|
|
|
class authController {
|
|
|
|
|
|
|
|
|
|
async getActive(req, res, next) {
|
|
|
|
|
try {
|
2024-09-22 21:00:15 -04:00
|
|
|
|
2024-09-27 14:16:11 -04:00
|
|
|
const authC = new AuthConfig();
|
|
|
|
|
authC.loadConfig();
|
|
|
|
|
|
|
|
|
|
const authActive = authC.getActiveAuth();
|
2024-09-22 21:00:15 -04:00
|
|
|
|
|
|
|
|
const response = {
|
2024-09-24 22:00:28 -04:00
|
|
|
authActive
|
2024-09-22 14:52:41 -04:00
|
|
|
};
|
2024-09-22 21:00:15 -04:00
|
|
|
return res.json(response);
|
2024-09-22 14:52:41 -04:00
|
|
|
}
|
|
|
|
|
catch (error) {
|
2024-09-22 21:00:15 -04:00
|
|
|
return next(error); // Gérer l'erreur
|
2024-09-22 14:52:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = new authController;
|