Feat: トークンを削除できる機能 / Fix: meエンドポイントでレスポンスヘッダーにapplication/jsonがない問題 / Chg: エンドポイントの関数名をL.jsを統一
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user