mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-17 23:48:45 +00:00
DB 입출력시의 타입 가드 추가
This commit is contained in:
@@ -6,7 +6,7 @@ import db from "./drizzle";
|
||||
import { refreshToken } from "./schema";
|
||||
|
||||
const expiresIn = ms(env.jwt.refreshExp);
|
||||
const expiresAt = () => Date.now() + expiresIn;
|
||||
const expiresAt = () => new Date(Date.now() + expiresIn);
|
||||
|
||||
export const registerRefreshToken = async (
|
||||
userId: number,
|
||||
@@ -71,5 +71,5 @@ export const revokeRefreshToken = async (tokenId: string) => {
|
||||
};
|
||||
|
||||
export const cleanupExpiredRefreshTokens = async () => {
|
||||
await db.delete(refreshToken).where(lte(refreshToken.expiresAt, Date.now())).execute();
|
||||
await db.delete(refreshToken).where(lte(refreshToken.expiresAt, new Date())).execute();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user