Skip to content

Commit

Permalink
ref: stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Mar 4, 2024
1 parent a07d779 commit 879926e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 879926e

Please sign in to comment.