Compare commits

...

2 Commits

2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ import { config } from '../../config';
import { IllegalJWTError, JwtNotProvidedError, RefreshTokenCountInvalidError, UserDisabledError, UserNotFoundError } from '../../errors/AuthError'; import { IllegalJWTError, JwtNotProvidedError, RefreshTokenCountInvalidError, UserDisabledError, UserNotFoundError } from '../../errors/AuthError';
import { JwtCreator } from "../../jwtcreator"; import { JwtCreator } from "../../jwtcreator";
import { User } from '../entities/User'; import { User } from '../entities/User';
import { Auth } from '../responses/ResponseAuth'; import { ResponseAuth } from '../responses/ResponseAuth';
/** /**
* This class is used to create refreshed auth credentials. * This class is used to create refreshed auth credentials.
@ -24,8 +24,8 @@ export class RefreshAuth {
/** /**
* Creates a new auth object based on this. * Creates a new auth object based on this.
*/ */
public async toAuth(): Promise<Auth> { public async toAuth(): Promise<ResponseAuth> {
let newAuth: Auth = new Auth(); let newAuth: ResponseAuth = new ResponseAuth();
if (!this.token || this.token === undefined) { if (!this.token || this.token === undefined) {
throw new JwtNotProvidedError() throw new JwtNotProvidedError()
} }

View File

@ -5,7 +5,7 @@ import { InvalidCredentialsError, PasswordNeededError, UserDisabledError, UserNo
import { UsernameOrEmailNeededError } from '../../../errors/UserErrors'; import { UsernameOrEmailNeededError } from '../../../errors/UserErrors';
import { JwtCreator } from '../../../jwtcreator'; import { JwtCreator } from '../../../jwtcreator';
import { User } from '../../entities/User'; import { User } from '../../entities/User';
import { Auth } from '../../responses/ResponseAuth'; import { ResponseAuth } from '../../responses/ResponseAuth';
/** /**
* This class is used to create auth credentials based on user credentials provided in a json body (post request). * This class is used to create auth credentials based on user credentials provided in a json body (post request).
@ -42,8 +42,8 @@ export class CreateAuth {
/** /**
* Creates a new auth object based on this. * Creates a new auth object based on this.
*/ */
public async toAuth(): Promise<Auth> { public async toAuth(): Promise<ResponseAuth> {
let newAuth: Auth = new Auth(); let newAuth: ResponseAuth = new ResponseAuth();
if (this.email === undefined && this.username === undefined) { if (this.email === undefined && this.username === undefined) {
throw new UsernameOrEmailNeededError(); throw new UsernameOrEmailNeededError();