mirror of
https://github.com/standardnotes/server
synced 2026-10-21 06:03:37 -04:00
feat(auth): add session traces cleanup procedure
This commit is contained in:
@@ -10,6 +10,14 @@ export class MySQLSessionTraceRepository implements SessionTraceRepositoryInterf
|
||||
private mapper: MapperInterface<SessionTrace, TypeORMSessionTrace>,
|
||||
) {}
|
||||
|
||||
async removeExpiredBefore(date: Date): Promise<void> {
|
||||
await this.ormRepository
|
||||
.createQueryBuilder()
|
||||
.delete()
|
||||
.where('expires_at < :date', { date: date.toISOString() })
|
||||
.execute()
|
||||
}
|
||||
|
||||
async findOneByUserUuidAndDate(userUuid: Uuid, date: Date): Promise<SessionTrace | null> {
|
||||
const typeOrm = await this.ormRepository
|
||||
.createQueryBuilder('trace')
|
||||
|
||||
Reference in New Issue
Block a user