This commit is contained in:
Amri Toufali 2023-04-20 15:26:20 -07:00
Родитель 3c50bc296b
Коммит e787002d34
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 75269D7487754F5D
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import bodyParser from 'body-parser'
import express from 'express'
import { Router } from 'express'
import { asyncMiddleware } from '../middleware/util.js'
@ -21,7 +21,6 @@ import { unsubscribeFromEmails } from '../utils/email.js'
import AppConstants from '../appConstants.js'
const router = Router()
const urlEncodedParser = bodyParser.urlencoded({ extended: false })
// dashboard page
// MNTOR-1327: for v2 release, we want to temp redirect users from dashboard
@ -49,12 +48,12 @@ router.get('/settings', requireSessionUser, settingsPage)
router.get('/logout', asyncMiddleware(logout))
// unsubscribe from emails
router.get('/unsubscribe', urlEncodedParser, asyncMiddleware(unsubscribePage))
router.get('/unsubscribe', express.urlencoded({ extended: false }), asyncMiddleware(unsubscribePage))
router.post('/unsubscribe', asyncMiddleware(unsubscribeFromEmails))
router.get(
'/unsubscribe-monthly',
urlEncodedParser,
express.urlencoded({ extended: false }),
asyncMiddleware(unsubscribeMonthlyPage)
)