[FEATURE] Cairo Auth Integration

This commit is contained in:
Dunemask 2024-02-04 17:02:15 -07:00
parent 184f1fa631
commit cdea22c08a
16 changed files with 89 additions and 45 deletions

View file

@ -19,6 +19,7 @@ const cairoAuthHandler = (req, res, next) => {
if (!req.token) return res.status(401).send("Cairo auth required!");
VERB("AUTH", `${MCL_CAIRO_URL}/api/user/info`);
cairoAuthenticate(req.token)
.then((authData) => (req.cairoId = authData.id))
.then(() => next())
.catch((err) => {
ERR("AUTH", err.response ? err.response.data : err.message);