refactor: Switch from official argon2 to Bun's implementation

This commit is contained in:
2026-02-20 21:59:56 +01:00
parent c9b8614f53
commit a1e697acb2
9 changed files with 85 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
import { verify } from '@node-rs/argon2';
import * as Bun from 'bun';
import { Request, Response } from 'express';
import { getConnectionManager } from 'typeorm';
import { StatsClient } from '../models/entities/StatsClient';
@@ -55,7 +55,7 @@ const StatsAuth = async (req: Request, res: Response, next: () => void) => {
}
}
else {
if (!(await verify(client.key, provided_token))) {
if (!(await Bun.password.verify(provided_token, client.key))) {
res.status(401).send("Api token invalid.");
return;
}