chore(guild): require CENTER_API_KEY when introspecting center
This commit is contained in:
@@ -2,8 +2,9 @@ export async function introspectGuildToken(token: string): Promise<{ active: boo
|
||||
const centerBaseUrl = process.env.CENTER_BASE_URL;
|
||||
const sharedSecret = process.env.CENTER_SHARED_SECRET;
|
||||
const guildNodeId = process.env.GUILD_NODE_ID;
|
||||
const centerApiKey = process.env.CENTER_API_KEY;
|
||||
|
||||
if (!centerBaseUrl || !sharedSecret || !guildNodeId) {
|
||||
if (!centerBaseUrl || !sharedSecret || !guildNodeId || !centerApiKey) {
|
||||
return { active: false };
|
||||
}
|
||||
|
||||
@@ -12,6 +13,7 @@ export async function introspectGuildToken(token: string): Promise<{ active: boo
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'x-center-shared-secret': sharedSecret,
|
||||
'x-api-key': centerApiKey,
|
||||
},
|
||||
body: JSON.stringify({ token, guildNodeId }),
|
||||
});
|
||||
@@ -25,4 +27,3 @@ export async function introspectGuildToken(token: string): Promise<{ active: boo
|
||||
user: data.user,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user