'A second request to the same route is being denied, even though I set the expiration limit to more hours

I am using NestJS for the backend, and using JWT for authentication. The problem is that it works, but if I try to make a second request via Postman, it denies me, as if I didn't have the bearer token.

I am using these configurations. I am implementing a JWTGuard, pretty much equal to the one in the documentation

JwtModule.registerAsync({
      imports: [ConfigModule],
      useFactory: async (configService: ConfigService) => {
        const options: JwtModuleOptions = {
          secret: configService.get('JWT_SECRET'),
          signOptions: {
            expiresIn: '2h', 
          },
        };
        return options;
      },
      inject: [ConfigService],
    }),

It may be this, I am using this code in Postman for automatically set the access token

const jsonData = pm.response.json()
pm.globals.set("accessToken", jsonData.access_token);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source