diff --git a/src/api/private/tokens/tokens.controller.ts b/src/api/private/tokens/tokens.controller.ts index 87ab494f9..d0de614a6 100644 --- a/src/api/private/tokens/tokens.controller.ts +++ b/src/api/private/tokens/tokens.controller.ts @@ -15,8 +15,10 @@ import { } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { AuthTokenWithSecretDto } from '../../../auth/auth-token-with-secret.dto'; -import { AuthTokenDto } from '../../../auth/auth-token.dto'; +import { + AuthTokenDto, + AuthTokenWithSecretDto, +} from '../../../auth/auth-token.dto'; import { AuthService } from '../../../auth/auth.service'; import { SessionGuard } from '../../../identity/session.guard'; import { ConsoleLoggerService } from '../../../logger/console-logger.service'; diff --git a/src/auth/auth-token-with-secret.dto.ts b/src/auth/auth-token-with-secret.dto.ts deleted file mode 100644 index 1ade7532d..000000000 --- a/src/auth/auth-token-with-secret.dto.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) - * - * SPDX-License-Identifier: AGPL-3.0-only - */ -import { IsString } from 'class-validator'; - -import { AuthTokenDto } from './auth-token.dto'; - -export class AuthTokenWithSecretDto extends AuthTokenDto { - @IsString() - secret: string; -} diff --git a/src/auth/auth-token.dto.ts b/src/auth/auth-token.dto.ts index 59a712769..dbf2c92b8 100644 --- a/src/auth/auth-token.dto.ts +++ b/src/auth/auth-token.dto.ts @@ -28,3 +28,8 @@ export class AuthTokenDto extends BaseDto { @IsOptional() lastUsedAt: Date | null; } + +export class AuthTokenWithSecretDto extends AuthTokenDto { + @IsString() + secret: string; +} diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 16ac4451e..0160ed782 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -19,8 +19,7 @@ import { User } from '../users/user.entity'; import { UsersService } from '../users/users.service'; import { bufferToBase64Url } from '../utils/password'; import { TimestampMillis } from '../utils/timestamp'; -import { AuthTokenWithSecretDto } from './auth-token-with-secret.dto'; -import { AuthTokenDto } from './auth-token.dto'; +import { AuthTokenDto, AuthTokenWithSecretDto } from './auth-token.dto'; import { AuthToken } from './auth-token.entity'; @Injectable() diff --git a/test/test-setup.ts b/test/test-setup.ts index bc0e696ed..8dadd7cc5 100644 --- a/test/test-setup.ts +++ b/test/test-setup.ts @@ -12,7 +12,7 @@ import { Connection, createConnection } from 'typeorm'; import { PrivateApiModule } from '../src/api/private/private-api.module'; import { PublicApiModule } from '../src/api/public/public-api.module'; -import { AuthTokenWithSecretDto } from '../src/auth/auth-token-with-secret.dto'; +import { AuthTokenWithSecretDto } from '../src/auth/auth-token.dto'; import { AuthModule } from '../src/auth/auth.module'; import { AuthService } from '../src/auth/auth.service'; import { MockAuthGuard } from '../src/auth/mock-auth.guard';