mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(server): add model base (#9734)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { PrismaClient, type VerificationToken } from '@prisma/client';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type VerificationToken } from '@prisma/client';
|
||||
|
||||
import { CryptoHelper } from '../base/helpers';
|
||||
import { BaseModel } from './base';
|
||||
|
||||
export type { VerificationToken };
|
||||
|
||||
@@ -16,12 +17,10 @@ export enum TokenType {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class VerificationTokenModel {
|
||||
private readonly logger = new Logger(VerificationTokenModel.name);
|
||||
constructor(
|
||||
private readonly db: PrismaClient,
|
||||
private readonly crypto: CryptoHelper
|
||||
) {}
|
||||
export class VerificationTokenModel extends BaseModel {
|
||||
constructor(private readonly crypto: CryptoHelper) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* create token by type and credential (optional) with ttl in seconds (default 30 minutes)
|
||||
|
||||
Reference in New Issue
Block a user