From 879926eaac88214bb0a212b6369f2dc461f4d4b1 Mon Sep 17 00:00:00 2001 From: Sv443 Date: Mon, 4 Mar 2024 22:12:20 +0100 Subject: [PATCH] ref: stuff --- src/auth.ts | 4 +++- src/server/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/auth.ts b/src/auth.ts index 70f2dd5f..824d4c9f 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -4,6 +4,8 @@ export function init() { void 0; } -export function validToken(token: string) { +/** Validates a passed token */ +export function isValidToken(token: string) { + // TODO: return false; } diff --git a/src/server/index.ts b/src/server/index.ts index fa6b87d4..13a181e7 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -12,7 +12,7 @@ import type { JSONCompatible } from "svcorelib"; import { settings } from "../settings.js"; import { initFuncs as routeInitFuncs } from "../routes/index.js"; import { error } from "../error.js"; -import { validToken } from "../auth.js"; +import { isValidToken } from "../auth.js"; import { genericRateLimit } from "../rateLimiters.js"; import type { ResponseFormat } from "../types/index.js"; @@ -53,7 +53,7 @@ export async function init() { res.setHeader("API-Info", `${settings.info.name} v${settings.info.version} (${settings.info.homepage})`); - if(authToken && validToken(authToken)) + if(authToken && isValidToken(authToken)) return next(); const clientIp = getClientIp(req);