All files / auth/responses token.response.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 252x 2x         2x           2x           2x     12x      
import { ApiProperty } from '@nestjs/swagger'
import { Expose } from 'class-transformer'
 
/**
 * @description Response for returning access_- and refresh_token
 */
export class TokenResponse {
  @Expose()
  @ApiProperty({
    description:
      'JWT access_token used for direct access to protected endpoints',
  })
  access_token: string
 
  @Expose()
  @ApiProperty({
    description: 'JWT refresh_token used for refreshing the access_token',
  })
  refresh_token: string
 
  constructor(data: Partial<TokenResponse>) {
    Object.assign(this, data)
  }
}