LISTS_PUBLIC
This commit is contained in:
parent
12558d3384
commit
fc9fbc6bdf
5 changed files with 37 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
const verifyAuth = require('../middlewares/verifyAuth')
|
||||
const publicRoute = require('../middlewares/publicRoute')
|
||||
const express = require('express')
|
||||
const path = require('path')
|
||||
|
||||
|
@ -16,7 +16,7 @@ module.exports = ({ db, config }) => {
|
|||
next()
|
||||
}
|
||||
},
|
||||
verifyAuth(),
|
||||
publicRoute(),
|
||||
(req, res) => {
|
||||
res.redirect('/wishlist')
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const verifyAuth = require('../../middlewares/verifyAuth')
|
||||
const publicRoute = require('../../middlewares/publicRoute')
|
||||
const getProductName = require('get-product-name')
|
||||
const express = require('express')
|
||||
const config = require('../../config')
|
||||
|
@ -29,7 +30,7 @@ const ValidURL = (string) => { // Ty SO
|
|||
module.exports = (db) => {
|
||||
const router = express.Router()
|
||||
|
||||
router.get('/', verifyAuth(), async (req, res) => {
|
||||
router.get('/', publicRoute(), async (req, res) => {
|
||||
const docs = await db.allDocs({ include_docs: true })
|
||||
if (process.env.SINGLE_LIST === 'true') {
|
||||
for (const row of docs.rows) {
|
||||
|
@ -39,7 +40,7 @@ module.exports = (db) => {
|
|||
res.render('wishlists', { title: 'Wishlists', users: docs.rows, totals })
|
||||
})
|
||||
|
||||
router.get('/:user', verifyAuth(), async (req, res) => {
|
||||
router.get('/:user', publicRoute(), async (req, res) => {
|
||||
try {
|
||||
const dbUser = await db.get(req.params.user)
|
||||
if (process.env.SINGLE_LIST === 'true') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue