This commit is contained in:
2025-12-31 19:55:43 +01:00
parent 8260bf7baf
commit 167e82a52b
66 changed files with 5124 additions and 228 deletions

View File

@@ -1,4 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsString, MinLength, IsIn } from 'class-validator';
export class AuthenticatedUserDTO {
@ApiProperty()
@@ -7,6 +8,10 @@ export class AuthenticatedUserDTO {
email!: string;
@ApiProperty()
displayName!: string;
@ApiProperty({ required: false })
primaryDriverId?: string;
@ApiProperty({ required: false, nullable: true })
avatarUrl?: string | null;
}
export class AuthSessionDTO {
@@ -53,3 +58,27 @@ export class LoginWithIracingCallbackParamsDTO {
@ApiProperty({ required: false })
returnTo?: string;
}
export class ForgotPasswordDTO {
@ApiProperty()
@IsEmail()
email!: string;
}
export class ResetPasswordDTO {
@ApiProperty()
@IsString()
token!: string;
@ApiProperty()
@IsString()
@MinLength(8)
newPassword!: string;
}
export class DemoLoginDTO {
@ApiProperty({ enum: ['driver', 'sponsor', 'league-owner', 'league-steward', 'league-admin', 'system-owner', 'super-admin'] })
@IsString()
@IsIn(['driver', 'sponsor', 'league-owner', 'league-steward', 'league-admin', 'system-owner', 'super-admin'])
role!: 'driver' | 'sponsor' | 'league-owner' | 'league-steward' | 'league-admin' | 'system-owner' | 'super-admin';
}