Here is my NestJS auth practice project, I have created iam directory and there with help of access-token.guard.ts I want to verify access token, then I wanted to create a custom decorator @Auth to declare some routes as public that's why created another guard authorization.guard.ts, But it's not working, without using this decorator, I should have got 401 unauthorized response, but I am getting 200 ok response. What i am doing wrong here? I am giving the iam.module.ts file here, and authorization.guard.ts file in picture
// iam.module.ts
@Module({
imports: [
TypeOrmModule.forFeature([User]),
JwtModule.registerAsync(jwtConfig.asProvider()),
ConfigModule.forFeature(jwtConfig),
],
providers: [
{
provide: HashingService,
useClass: BcryptService,
},
{
provide: APP_GUARD,
useClass: AuthenticationGuard,
},
AccessTokenGuard,
AuthenticationService,
],
controllers: [AuthenticationController],
})
export class IamModule {}