22 lines
595 B
TypeScript
22 lines
595 B
TypeScript
|
import {
|
||
|
MiddlewareConsumer,
|
||
|
Module,
|
||
|
NestModule,
|
||
|
RequestMethod,
|
||
|
} from '@nestjs/common';
|
||
|
import { ValidateCSRFMiddleware } from 'src/middleware/validate-csrf.middleware';
|
||
|
import { UserModule } from 'src/modules/objects/user/user.module';
|
||
|
import { RegisterController } from './register.controller';
|
||
|
|
||
|
@Module({
|
||
|
imports: [UserModule],
|
||
|
controllers: [RegisterController],
|
||
|
})
|
||
|
export class RegisterModule implements NestModule {
|
||
|
configure(consumer: MiddlewareConsumer) {
|
||
|
consumer
|
||
|
.apply(ValidateCSRFMiddleware)
|
||
|
.forRoutes({ path: '*', method: RequestMethod.POST });
|
||
|
}
|
||
|
}
|