mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-14 07:45:39 +01:00
Make backend and frontend work together
This commit is contained in:
38
backend/src/routes/api/auth/auth.dto.ts
Normal file
38
backend/src/routes/api/auth/auth.dto.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import {
|
||||
IsBoolean,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { User } from 'src/collections/userdb/user.dto';
|
||||
|
||||
export class LoginResponseDto {
|
||||
@IsString()
|
||||
access_token: string;
|
||||
}
|
||||
|
||||
export class RegisterRequestDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
username: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
password: string;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
isAdmin?: boolean;
|
||||
}
|
||||
|
||||
export class DeleteRequestDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
username: string;
|
||||
}
|
||||
|
||||
export class JwtDataDto {
|
||||
@ValidateNested()
|
||||
user: User;
|
||||
}
|
||||
Reference in New Issue
Block a user