feat: remove appwrite and add nextjs backend
This commit is contained in:
26
backend/src/auth/dto/auth.dto.ts
Normal file
26
backend/src/auth/dto/auth.dto.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Expose, plainToClass } from "class-transformer";
|
||||
import { IsEmail, IsNotEmpty, IsString } from "class-validator";
|
||||
|
||||
export class AuthDTO {
|
||||
@Expose()
|
||||
id: string;
|
||||
|
||||
@Expose()
|
||||
firstName: string;
|
||||
|
||||
@Expose()
|
||||
lastName: string;
|
||||
|
||||
@Expose()
|
||||
@IsNotEmpty()
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
password: string;
|
||||
|
||||
constructor(partial: Partial<AuthDTO>) {
|
||||
return plainToClass(AuthDTO, partial, { excludeExtraneousValues: true });
|
||||
}
|
||||
}
|
||||
4
backend/src/auth/dto/authRegister.dto.ts
Normal file
4
backend/src/auth/dto/authRegister.dto.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { PickType } from "@nestjs/swagger";
|
||||
import { AuthDTO } from "./auth.dto";
|
||||
|
||||
export class AuthRegisterDTO extends AuthDTO {}
|
||||
7
backend/src/auth/dto/authSignIn.dto.ts
Normal file
7
backend/src/auth/dto/authSignIn.dto.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { PickType } from "@nestjs/swagger";
|
||||
import { AuthDTO } from "./auth.dto";
|
||||
|
||||
export class AuthSignInDTO extends PickType(AuthDTO, [
|
||||
"email",
|
||||
"password",
|
||||
] as const) {}
|
||||
6
backend/src/auth/dto/refreshAccessToken.dto.ts
Normal file
6
backend/src/auth/dto/refreshAccessToken.dto.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { IsNotEmpty, IsString } from "class-validator";
|
||||
|
||||
export class RefreshAccessTokenDTO {
|
||||
@IsNotEmpty()
|
||||
refreshToken: string;
|
||||
}
|
||||
Reference in New Issue
Block a user