makes max IP limit configurable per-user
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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") { %>
|
||||
|
||||
Reference in New Issue
Block a user