fix issues
This commit is contained in:
@@ -84,8 +84,9 @@ export class DemoLoginUseCase implements UseCase<DemoLoginInput, void, DemoLogin
|
||||
passwordHash,
|
||||
};
|
||||
|
||||
// Always set primaryDriverId for demo users to ensure dashboard works
|
||||
userProps.primaryDriverId = `demo-${input.role}-${userId.value}`;
|
||||
if (config.primaryDriverId) {
|
||||
userProps.primaryDriverId = `demo-${input.role}-${userId.value}`;
|
||||
// Add avatar URL for demo users with primary driver
|
||||
// Use the same format as seeded drivers: /media/default/neutral-default-avatar
|
||||
userProps.avatarUrl = '/media/default/neutral-default-avatar';
|
||||
|
||||
@@ -50,8 +50,11 @@ export class SignupParamsDTO {
|
||||
|
||||
export class LoginParamsDTO {
|
||||
@ApiProperty()
|
||||
@IsEmail()
|
||||
email!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
password!: string;
|
||||
}
|
||||
|
||||
@@ -64,10 +67,15 @@ export class IracingAuthRedirectResultDTO {
|
||||
|
||||
export class LoginWithIracingCallbackParamsDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
code!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
state!: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsString()
|
||||
returnTo?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { AppModule } from './app.module';
|
||||
import { AuthenticationGuard } from './domain/auth/AuthenticationGuard';
|
||||
import { AuthorizationGuard } from './domain/auth/AuthorizationGuard';
|
||||
import { FeatureAvailabilityGuard } from './domain/policy/FeatureAvailabilityGuard';
|
||||
import { getGenerateOpenapi } from './env';
|
||||
|
||||
async function bootstrap() {
|
||||
@@ -35,16 +38,15 @@ async function bootstrap() {
|
||||
}),
|
||||
);
|
||||
|
||||
// Guards (commented out to isolate DI issue)
|
||||
// try {
|
||||
// const authGuard = app.get(AuthenticationGuard);
|
||||
// const authzGuard = app.get(AuthorizationGuard);
|
||||
// const featureGuard = app.get(FeatureAvailabilityGuard);
|
||||
// app.useGlobalGuards(authGuard, authzGuard, featureGuard);
|
||||
// } catch (error) {
|
||||
// console.error('Failed to register guards:', error);
|
||||
// throw error;
|
||||
// }
|
||||
try {
|
||||
const authGuard = app.get(AuthenticationGuard);
|
||||
const authzGuard = app.get(AuthorizationGuard);
|
||||
const featureGuard = app.get(FeatureAvailabilityGuard);
|
||||
app.useGlobalGuards(authGuard, authzGuard, featureGuard);
|
||||
} catch (error) {
|
||||
console.error('Failed to register guards:', error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
// Swagger
|
||||
const config = new DocumentBuilder()
|
||||
|
||||
Reference in New Issue
Block a user