makes max IP limit configurable per-user

This commit is contained in:
nai-degen
2023-09-18 23:16:06 -05:00
parent 40e71435f0
commit c6453638e9
8 changed files with 74 additions and 54 deletions
+6 -1
View File
@@ -20,7 +20,12 @@ router.get("/", (_req, res) => {
});
router.get("/lookup", (_req, res) => {
res.render("user_lookup", { user: res.locals.currentSelfServiceUser });
const ipLimit =
(res.locals.currentSelfServiceUser?.maxIps ?? config.maxIpsPerUser) || 0;
res.render("user_lookup", {
user: res.locals.currentSelfServiceUser,
ipLimit,
});
});
router.post("/lookup", (req, res) => {
+1 -1
View File
@@ -51,7 +51,7 @@
<td colspan="2"><%- user.lastUsedAt || "never" %></td>
</tr>
<tr>
<th scope="row">IPs<%- maxIps ? ` (max ${maxIps})` : "" %> </th>
<th scope="row">IPs<%- ipLimit ? ` (max ${ipLimit})` : "" %></th>
<td colspan="2"><%- include("partials/shared_user_ip_list", { user, shouldRedact: true }) %></td>
</tr>
<% if (user.type === "temporary") { %>