Loading packages/server/src/api/client.ts +68 −58 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => { }); } try { const whoami = await OpenID.client.userinfo<{ instance: { software: { Loading @@ -171,7 +172,10 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => { const [username, hostname] = whoami.sub.split("@"); const instance = await Instance.fromAuth(hostname, whoami.instance.instance); const instance = await Instance.fromAuth( hostname, whoami.instance.instance ); const instanceBan = await instance.getEffectiveBan(); if (instanceBan) { res.redirect( Loading Loading @@ -218,6 +222,12 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => { }; req.session.save(); res.redirect("/"); } catch (e) { console.error("callback error", e); res .status(500) .json({ success: false, error: "internal error, try again" }); } }); app.get("/canvas/pixel/:x/:y", RateLimiter.HIGH, async (req, res) => { Loading Loading
packages/server/src/api/client.ts +68 −58 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => { }); } try { const whoami = await OpenID.client.userinfo<{ instance: { software: { Loading @@ -171,7 +172,10 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => { const [username, hostname] = whoami.sub.split("@"); const instance = await Instance.fromAuth(hostname, whoami.instance.instance); const instance = await Instance.fromAuth( hostname, whoami.instance.instance ); const instanceBan = await instance.getEffectiveBan(); if (instanceBan) { res.redirect( Loading Loading @@ -218,6 +222,12 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => { }; req.session.save(); res.redirect("/"); } catch (e) { console.error("callback error", e); res .status(500) .json({ success: false, error: "internal error, try again" }); } }); app.get("/canvas/pixel/:x/:y", RateLimiter.HIGH, async (req, res) => { Loading