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

mozilla / blurts-server / #13275

pending completion
#13275

push

circleci

rhelmer
MNTOR-1452 - use UPDATE FOR to lock table and prevent race condition when adding email

282 of 1679 branches covered (16.8%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

959 of 4548 relevant lines covered (21.09%)

1.76 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 { exposuresPage } from '../controllers/exposures.js'
14
import { dataRemovalPage } from '../controllers/dataRemoval.js'
15
import { settingsPage } from '../controllers/settings.js'
16
import {
17
  unsubscribePage,
18
  unsubscribeMonthlyPage
19
} from '../controllers/unsubscribe.js'
20
import { unsubscribeFromEmails } from '../utils/email.js'
21

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

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

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

35
// data exposures detail page
36
router.get('/exposures', requireSessionUser, exposuresPage)
×
37

38
// data removal page
39
router.get('/data-removal', requireSessionUser, dataRemovalPage)
×
40

41
// settings page
42
router.get('/settings', requireSessionUser, settingsPage)
×
43

44
// sign the user out
45
router.get('/logout', asyncMiddleware(logout))
×
46

47
// unsubscribe from emails
48
router.get('/unsubscribe', urlEncodedParser, asyncMiddleware(unsubscribePage))
×
49
router.post('/unsubscribe', asyncMiddleware(unsubscribeFromEmails))
×
50

51
router.get(
×
52
  '/unsubscribe-monthly',
53
  urlEncodedParser,
54
  asyncMiddleware(unsubscribeMonthlyPage)
55
)
56

57
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