fix issues

This commit is contained in:
2026-01-01 20:31:05 +01:00
parent 9005a8327c
commit 206a03ec48
267 changed files with 3632 additions and 452 deletions

View File

@@ -6,6 +6,24 @@
"version": "1.0.0"
},
"paths": {
"/admin/dashboard/stats": {
"get": {
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/admin/users": {
"get": {
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/analytics/dashboard": {
"get": {
"responses": {
@@ -42,6 +60,24 @@
}
}
},
"/auth/demo-login": {
"post": {
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/auth/forgot-password": {
"post": {
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/auth/iracing/callback": {
"get": {
"responses": {
@@ -78,6 +114,15 @@
}
}
},
"/auth/reset-password": {
"post": {
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/auth/session": {
"get": {
"responses": {
@@ -1405,6 +1450,16 @@
},
"displayName": {
"type": "string"
},
"primaryDriverId": {
"type": "string"
},
"avatarUrl": {
"type": "string",
"nullable": true
},
"role": {
"type": "string"
}
},
"required": [
@@ -2102,6 +2157,20 @@
"success"
]
},
"DemoLoginDTO": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"rememberMe": {
"type": "boolean"
}
},
"required": [
"role"
]
},
"DriverDTO": {
"type": "object",
"properties": {
@@ -2637,6 +2706,17 @@
"incident"
]
},
"ForgotPasswordDTO": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
},
"required": [
"email"
]
},
"FullTransactionDTO": {
"type": "object",
"properties": {
@@ -4490,6 +4570,10 @@
"timingSummary": {
"type": "string",
"nullable": true
},
"logoUrl": {
"type": "string",
"nullable": true
}
},
"required": [
@@ -4541,6 +4625,35 @@
"usedSlots"
]
},
"ListUsersRequestDTO": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"status": {
"type": "string"
},
"email": {
"type": "string"
},
"search": {
"type": "string"
},
"page": {
"type": "number"
},
"limit": {
"type": "number"
},
"sortBy": {
"type": "string"
},
"sortDirection": {
"type": "string"
}
}
},
"LoginParamsDTO": {
"type": "object",
"properties": {
@@ -4549,6 +4662,9 @@
},
"password": {
"type": "string"
},
"rememberMe": {
"type": "boolean"
}
},
"required": [
@@ -5815,6 +5931,21 @@
"stewardId"
]
},
"ResetPasswordDTO": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"newPassword": {
"type": "string"
}
},
"required": [
"token",
"newPassword"
]
},
"ReviewProtestCommandDTO": {
"type": "object",
"properties": {
@@ -7039,6 +7170,87 @@
"fee"
]
},
"UserListResponseDTO": {
"type": "object",
"properties": {
"users": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserResponseDTO"
}
},
"total": {
"type": "number"
},
"page": {
"type": "number"
},
"limit": {
"type": "number"
},
"totalPages": {
"type": "number"
}
},
"required": [
"users",
"total",
"page",
"limit",
"totalPages"
]
},
"UserResponseDTO": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"displayName": {
"type": "string"
},
"roles": {
"type": "array",
"items": {
"type": "string"
}
},
"status": {
"type": "string"
},
"isSystemAdmin": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"lastLoginAt": {
"type": "string",
"format": "date-time"
},
"primaryDriverId": {
"type": "string"
}
},
"required": [
"id",
"email",
"displayName",
"roles",
"status",
"isSystemAdmin",
"createdAt",
"updatedAt"
]
},
"ValidateFaceInputDTO": {
"type": "object",
"properties": {

View File

@@ -149,11 +149,18 @@ export class AuthService {
}
const userDTO = this.authSessionPresenter.responseModel;
const session = await this.identitySessionPort.createSession({
id: userDTO.userId,
displayName: userDTO.displayName,
email: userDTO.email,
});
const sessionOptions = params.rememberMe !== undefined
? { rememberMe: params.rememberMe }
: undefined;
const session = await this.identitySessionPort.createSession(
{
id: userDTO.userId,
displayName: userDTO.displayName,
email: userDTO.email,
},
sessionOptions
);
return {
token: session.token,
@@ -269,7 +276,7 @@ export class AuthService {
return this.resetPasswordPresenter.responseModel;
}
async demoLogin(params: { role: 'driver' | 'sponsor' | 'league-owner' | 'league-steward' | 'league-admin' | 'system-owner' | 'super-admin' }): Promise<AuthSessionDTO> {
async demoLogin(params: { role: 'driver' | 'sponsor' | 'league-owner' | 'league-steward' | 'league-admin' | 'system-owner' | 'super-admin', rememberMe?: boolean }): Promise<AuthSessionDTO> {
this.logger.debug(`[AuthService] Attempting demo login for role: ${params.role}`);
this.demoLoginPresenter.reset();
@@ -291,11 +298,18 @@ export class AuthService {
// Use primaryDriverId for session if available, otherwise fall back to userId
const sessionId = primaryDriverId ?? user.getId().value;
const session = await this.identitySessionPort.createSession({
id: sessionId,
displayName: user.getDisplayName(),
email: user.getEmail() ?? '',
});
const sessionOptions = params.rememberMe !== undefined
? { rememberMe: params.rememberMe }
: undefined;
const session = await this.identitySessionPort.createSession(
{
id: sessionId,
displayName: user.getDisplayName(),
email: user.getEmail() ?? '',
},
sessionOptions
);
const userDTO: AuthenticatedUserDTO = {
userId: user.getId().value,

View File

@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsString, MinLength, IsIn } from 'class-validator';
import { IsEmail, IsString, MinLength, IsIn, IsOptional } from 'class-validator';
export class AuthenticatedUserDTO {
@ApiProperty()
@@ -56,6 +56,10 @@ export class LoginParamsDTO {
@ApiProperty()
@IsString()
password!: string;
@ApiProperty({ required: false, default: false })
@IsOptional()
rememberMe?: boolean;
}
export class IracingAuthRedirectResultDTO {
@@ -101,4 +105,8 @@ export class DemoLoginDTO {
@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';
@ApiProperty({ required: false, default: false })
@IsOptional()
rememberMe?: boolean;
}