Added authlib support

This commit is contained in:
2025-12-28 22:10:14 +01:00
parent a7cf6ad5a1
commit a3eb5ee70c
4 changed files with 62 additions and 2 deletions

17
routes/index.js Normal file
View File

@@ -0,0 +1,17 @@
const express = require("express")
const router = express.Router()
const utils = require("../modules/utils")
const serverService = require("../services/serverService")
if (utils.isTrueFromDotEnv("SUPPORT_AUTHLIB_INJECTOR")) {
router.get("", (req, res) => {
const hostname = req.hostname
const metadata = serverService.getServerMetadata(hostname)
res.header("X-Authlib-Injector-Date", new Date().toISOString())
return res.status(200).json(metadata)
})
} else {
router.get("", (req, res, next) => next())
}
module.exports = router