• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / 45ba77d7-fd3c-4064-90eb-157d6aa10611

pending completion
45ba77d7-fd3c-4064-90eb-157d6aa10611

push

circleci

Robert Helmer
update the queue adr

282 of 1631 branches covered (17.29%)

Branch coverage included in aggregate %.

959 of 4375 relevant lines covered (21.92%)

3.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/routes/user.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import bodyParser from 'body-parser'
6
import { Router } from 'express'
7

8
import { asyncMiddleware } from '../middleware/util.js'
9
import { requireSessionUser } from '../middleware/auth.js'
10
import { logout } from '../controllers/auth.js'
11
// import { dashboardPage } from '../controllers/dashboard.js'
12
import { breachesPage } from '../controllers/breaches.js'
13
import { dataRemovalPage } from '../controllers/data-removal.js'
14
import { settingsPage } from '../controllers/settings.js'
15
import {
16
  unsubscribePage,
17
  unsubscribeMonthlyPage
18
} from '../controllers/unsubscribe.js'
19
import { unsubscribeFromEmails } from '../utils/email.js'
20

21
const router = Router()
×
22
const urlEncodedParser = bodyParser.urlencoded({ extended: false })
×
23

24
// dashboard page
25
// MNTOR-1327: for v2 release, we want to temp redirect users from dashboard
26
// to breach details page for backwards compatibility reasons. Old emails still
27
// have a reference to the dashboard URI.
28
// TODO: remove after we have a dashboard
29
router.get('/dashboard', (req, res) => res.redirect(302, '/user/breaches'))
×
30

31
// data breaches detail page
32
router.get('/breaches', requireSessionUser, breachesPage)
×
33

34
// data removal page
35
router.get('/data-removal', requireSessionUser, dataRemovalPage)
×
36

37
// settings page
38
router.get('/settings', requireSessionUser, settingsPage)
×
39

40
// sign the user out
41
router.get('/logout', asyncMiddleware(logout))
×
42

43
// unsubscribe from emails
44
router.get('/unsubscribe', urlEncodedParser, asyncMiddleware(unsubscribePage))
×
45
router.post('/unsubscribe', asyncMiddleware(unsubscribeFromEmails))
×
46

47
router.get(
×
48
  '/unsubscribe-monthly',
49
  urlEncodedParser,
50
  asyncMiddleware(unsubscribeMonthlyPage)
51
)
52

53
export default router
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc