Compare commits
3 Commits
3e38bc5950
...
d803704eee
Author | SHA1 | Date | |
---|---|---|---|
d803704eee | |||
a5b1804e19 | |||
a7854fbe81 |
@ -1,5 +1,5 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { ForbiddenError, NotAcceptableError, UnauthorizedError } from 'routing-controllers';
|
||||
import { ForbiddenError, NotAcceptableError, NotFoundError, UnauthorizedError } from 'routing-controllers';
|
||||
|
||||
/**
|
||||
* Error to throw when a jwt is expired
|
||||
@ -65,4 +65,15 @@ export class PasswordNeededError extends NotAcceptableError {
|
||||
|
||||
@IsString()
|
||||
message = "no password is provided - you need to provide it"
|
||||
}
|
||||
|
||||
/**
|
||||
* Error to thow when no user could be found for provided credential
|
||||
*/
|
||||
export class UserNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "UserNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "no user could be found for provided credential"
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import * as argon2 from "argon2";
|
||||
import { IsEmail, IsOptional, IsPhoneNumber, IsString, IsUUID } from 'class-validator';
|
||||
import { IsEmail, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
|
||||
import { getConnectionManager } from 'typeorm';
|
||||
import * as uuid from 'uuid';
|
||||
import { UserGroupNotFoundError, UsernameOrEmailNeededError } from '../../errors/UserErrors';
|
||||
@ -26,8 +26,6 @@ export class CreateUser {
|
||||
email?: string;
|
||||
@IsOptional()
|
||||
groupId?: number[] | number
|
||||
@IsUUID("4")
|
||||
uuid: string;
|
||||
|
||||
public async toUser(): Promise<User> {
|
||||
let newUser: User = new User();
|
||||
|
Loading…
x
Reference in New Issue
Block a user