nest-project/src/auth/models/token.model.ts

16 lines
369 B
TypeScript
Raw Normal View History

2023-02-16 01:18:55 +08:00
import '@nestjs/mapped-types'
import { IntersectionType, ApiProperty, OmitType } from '@nestjs/swagger'
import { UserEntity } from 'src/users/entities/user.entity'
export class Token {
@ApiProperty()
accessToken: string
@ApiProperty()
refreshToken: string
}
export class UserToken extends IntersectionType(
Token,
OmitType(UserEntity, ['password']),
) {}