Feat: トークンを削除できる機能 / Fix: meエンドポイントでレスポンスヘッダーにapplication/jsonがない問題 / Chg: エンドポイントの関数名をL.jsを統一

This commit is contained in:
2026-03-20 18:34:37 +09:00
parent 0e615faa7f
commit fa7a1e87ff
10 changed files with 58 additions and 12 deletions
@@ -5,6 +5,7 @@ import { randomBytes } from "node:crypto";
import { UserEntity } from "@/modules/entities/User";
import { ErrorBase } from "@/errors";
import Logger from "@/lib/logger";
import type { FastifyInstance } from "fastify";
const logger = new Logger("Repo | Token.ts");
@@ -83,4 +84,12 @@ export class TokenRepository extends EntityRepository<TokenEntity> {
return token;
}
async deleteToken(token: TokenEntity, fastify?: FastifyInstance) {
await this.nativeDelete(token);
this.em.clear();
if (fastify)
fastify.orm.em.clear();
}
}