We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 609b012 commit 542e141Copy full SHA for 542e141
pages/api/[network]/get-names.js
@@ -59,13 +59,16 @@ async function handler(req, res) {
59
offset = 0;
60
}
61
62
-
63
const address = req.query.address;
64
const includeTextRecords = req.query.text_records;
65
const apiKey = headers.authorization || req.query.api_key;
66
// Check API key
67
68
const allowedApi = await checkApiKey(apiKey, domain);
+ // if apiKey exists and is not allowed, return 401
69
+ if (apiKey && !allowedApi) {
70
+ return res.status(401).json({ error: "Unauthorized" });
71
+ }
72
73
let domainIds = [];
74
if (domain) {
0 commit comments