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

mozilla / blurts-server / d9c77947-e4e8-4674-963c-053f795817eb

pending completion
d9c77947-e4e8-4674-963c-053f795817eb

Pull #2989

circleci

Vincent
fixup! fixup! Store exposure scan data at OneRep
Pull Request #2989: Add API to store data to scan for exposures

282 of 1740 branches covered (16.21%)

Branch coverage included in aggregate %.

117 of 117 new or added lines in 9 files covered. (100.0%)

959 of 4624 relevant lines covered (20.74%)

3.46 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/data-removal.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
import AppConstants from '../app-constants.js'
22

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

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

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

36
// Not ready yet, so don't expose in production:
37
if (AppConstants.NODE_ENV === 'dev') {
×
38
  // data exposures detail page
39
  router.get('/exposures', requireSessionUser, exposuresPage)
×
40
}
41

42
// data removal page
43
router.get('/data-removal', requireSessionUser, dataRemovalPage)
×
44

45
// settings page
46
router.get('/settings', requireSessionUser, settingsPage)
×
47

48
// sign the user out
49
router.get('/logout', asyncMiddleware(logout))
×
50

51
// unsubscribe from emails
52
router.get('/unsubscribe', urlEncodedParser, asyncMiddleware(unsubscribePage))
×
53
router.post('/unsubscribe', asyncMiddleware(unsubscribeFromEmails))
×
54

55
router.get(
×
56
  '/unsubscribe-monthly',
57
  urlEncodedParser,
58
  asyncMiddleware(unsubscribeMonthlyPage)
59
)
60

61
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