diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index e8d81cc..4e5ced1 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -5,8 +5,8 @@ import { UserNotFoundError } from '../errors/UserErrors'; import { CreateAuth } from '../models/creation/CreateAuth'; import { HandleLogout } from '../models/creation/HandleLogout'; import { RefreshAuth } from '../models/creation/RefreshAuth'; -import { Auth } from '../models/entities/Auth'; -import { Logout } from '../models/entities/Logout'; +import { Auth } from '../models/responses/Auth'; +import { Logout } from '../models/responses/Logout'; @JsonController('/auth') export class AuthController { diff --git a/src/models/creation/CreateAuth.ts b/src/models/creation/CreateAuth.ts index 5642375..140f9ef 100644 --- a/src/models/creation/CreateAuth.ts +++ b/src/models/creation/CreateAuth.ts @@ -4,8 +4,8 @@ import * as jsonwebtoken from 'jsonwebtoken'; import { getConnectionManager } from 'typeorm'; import { InvalidCredentialsError, PasswordNeededError, UserNotFoundError } from '../../errors/AuthError'; import { UsernameOrEmailNeededError } from '../../errors/UserErrors'; -import { Auth } from '../entities/Auth'; import { User } from '../entities/User'; +import { Auth } from '../responses/Auth'; export class CreateAuth { @IsOptional() diff --git a/src/models/creation/HandleLogout.ts b/src/models/creation/HandleLogout.ts index d1ee7b8..c50edd0 100644 --- a/src/models/creation/HandleLogout.ts +++ b/src/models/creation/HandleLogout.ts @@ -2,8 +2,8 @@ import { IsString } from 'class-validator'; import * as jsonwebtoken from 'jsonwebtoken'; import { getConnectionManager } from 'typeorm'; import { IllegalJWTError, JwtNotProvidedError, RefreshTokenCountInvalidError, UserNotFoundError } from '../../errors/AuthError'; -import { Logout } from '../entities/Logout'; import { User } from '../entities/User'; +import { Logout } from '../responses/Logout'; export class HandleLogout { @IsString() @@ -20,7 +20,6 @@ export class HandleLogout { } catch (error) { throw new IllegalJWTError() } - logout.access_token = this.token logout.timestamp = Math.floor(Date.now() / 1000) let found_user: User = await getConnectionManager().get().getRepository(User).findOne({ id: decoded["userid"] }); if (!found_user) { diff --git a/src/models/creation/RefreshAuth.ts b/src/models/creation/RefreshAuth.ts index ab947e6..66e27f8 100644 --- a/src/models/creation/RefreshAuth.ts +++ b/src/models/creation/RefreshAuth.ts @@ -2,8 +2,8 @@ import { IsString } from 'class-validator'; import * as jsonwebtoken from 'jsonwebtoken'; import { getConnectionManager } from 'typeorm'; import { IllegalJWTError, JwtNotProvidedError, RefreshTokenCountInvalidError, UserNotFoundError } from '../../errors/AuthError'; -import { Auth } from '../entities/Auth'; import { User } from '../entities/User'; +import { Auth } from '../responses/Auth'; export class RefreshAuth { @IsString() diff --git a/src/models/entities/Auth.ts b/src/models/responses/Auth.ts similarity index 100% rename from src/models/entities/Auth.ts rename to src/models/responses/Auth.ts diff --git a/src/models/entities/Logout.ts b/src/models/responses/Logout.ts similarity index 64% rename from src/models/entities/Logout.ts rename to src/models/responses/Logout.ts index d24d95f..f0c109d 100644 --- a/src/models/entities/Logout.ts +++ b/src/models/responses/Logout.ts @@ -4,11 +4,6 @@ import { IsString } from 'class-validator'; * Defines a Logout object */ export class Logout { - /** - * access_token - JWT shortterm access token - */ - @IsString() - access_token: string; /** * timestamp of logout */