saltyshiomix / ark

An easiest authentication system on top of NestJS, TypeORM, NEXT.js(v9.3) and Material UI(v4).
MIT License
259 stars 17 forks source link

Page without route is available #11

Closed Ridd0 closed 4 years ago

Ridd0 commented 4 years ago

Hey, I have a question - why routes are still available even if we comment AuthController? For example, I mean auth/login.

I guess it's related to the Nextjs framework. It seems to me that AuthController is unnecessary (it's never executing). I've tried made console.log from AuthController -> showLogin but it's not working.

Thanks!

saltyshiomix commented 4 years ago

Hi @Ridd0 , thank you for your reporting the issue!

This is a bug of server/app.module.ts:

export class AppModule implements NestModule {
  private handleAssets(consumer: MiddlewareConsumer): void {
    consumer
      .apply(NextMiddleware)
      .forRoutes({
        path: '_next*',
        method: RequestMethod.GET,
      });

    // this will be handle all pages in the `pages/*`, so NestJS routs won't work
    // consumer
    //   .apply(NextMiddleware)
    //   .forRoutes({
    //     path: '*',
    //     method: RequestMethod.GET,
    //   });
  }
}
saltyshiomix commented 4 years ago

Fixed v6.10.0, so you can see console.log() 👍

Ridd0 commented 4 years ago

Thanks, great job 👍