function jwt() {
const { secret } = config;
return expressJwt({ secret, algorithms: ["HS256"] }).unless({
path: [
// public routes that don't require authentication
"/users/authenticate",
"/users/create",
"/series/getAllSeries",
"/series/getByIdSeries/:id",
"/series/getByStreamingService/:streamingService",
"/series/getMonthSeries/:monthPosition/:streamingServiceName?",
],
});
}
This routes only work with token. The exception for them to work publicly does not work
"/series/getByIdSeries/:id",
"/series/getByStreamingService/:streamingService",
"/series/getMonthSeries/:monthPosition/:streamingServiceName?",