diff --git a/src/util/dtos/DmChannelDTO.ts b/src/util/dtos/DmChannelDTO.ts
index 5ab8ec4b..956fe48a 100644
--- a/src/util/dtos/DmChannelDTO.ts
+++ b/src/util/dtos/DmChannelDTO.ts
@@ -43,8 +43,8 @@ export class DmChannelDTO {
await Promise.all(
channel.recipients
?.filter((r) => !excluded_recipients.includes(r.user_id))
- .map(async (r) => {
- return await User.findOneOrFail({
+ .map((r) => {
+ return User.findOneOrFail({
where: { id: r.user_id },
select: PublicUserProjection,
});
diff --git a/src/util/util/WebAuthn.ts b/src/util/util/WebAuthn.ts
index b69af5ce..f3750e7c 100644
--- a/src/util/util/WebAuthn.ts
+++ b/src/util/util/WebAuthn.ts
@@ -55,7 +55,7 @@ export async function generateWebAuthnTicket(challenge: string): Promise<string>
export async function verifyWebAuthnToken(token: string) {
return new Promise((res, rej) => {
loadOrGenerateKeypair().then((kp) =>
- jwt.verify(token, kp.publicKey, jwtVerifyOptions, async (err, decoded) => {
+ jwt.verify(token, kp.publicKey, jwtVerifyOptions, (err, decoded) => {
if (err) return rej(err);
return res(decoded);
}),
diff --git a/src/util/util/networking/ipdata/IpDataClient.ts b/src/util/util/networking/ipdata/IpDataClient.ts
index 96b4c076..2812ef59 100644
--- a/src/util/util/networking/ipdata/IpDataClient.ts
+++ b/src/util/util/networking/ipdata/IpDataClient.ts
@@ -16,11 +16,12 @@ export class IpDataClient {
if (this.ipInfoCache.get(ip)?.expires ?? 0 > Date.now()) return this.ipInfoCache.get(ip)!.data;
console.log(`[IpData] Fetching info for IP address ${ip}...`);
- const resp = (await (await fetch(`https://eu-api.ipdata.co/${ip}?api-key=${ipdataApiKey}`)).json()) as Promise<IpDataIpLookupResponse>;
+ const response = await fetch(`https://eu-api.ipdata.co/${ip}?api-key=${ipdataApiKey}`);
+ const data = (await response.json()) as IpDataIpLookupResponse;
this.ipInfoCache.set(ip, {
- data: await resp,
+ data: data,
expires: new DateBuilder().addHours(12).buildTimestamp(),
});
- return await resp;
+ return data;
}
}
|