
'use strict'
const passport = require('../../utils/passportService')
const router = require('express').Router()
const secretController = require('./secretController')
router.get('/', passport.authenticate('jwt', { session: false }), secretController)

module.exports = router


'use strict'
const passport = require('../../utils/passportService')
const router = require('express').Router()
const secretController = require('./secretController')
const { authenticate } = require('../../config/middleware')

router.get('/', authenticate, secretController)

module.exports = router

Use the middleware to authenticate in place of passport
Use the middleware to authenticate in place of passport

 -- at lease for now there is no database lookup every time
     the  token is verified.
