CJVT updates August and September 2026
This commit is contained in:
@@ -27,6 +27,27 @@ router.get(
|
||||
dictionaries.listDictionaries
|
||||
)
|
||||
|
||||
// Change page in pagination (read-only "Ogled virov" list, any logged-in user).
|
||||
router.get(
|
||||
'/listAllViewableDictionaries',
|
||||
user.isAuthenticated,
|
||||
dictionaries.listDictionaries
|
||||
)
|
||||
|
||||
// Soft-warning check: does a candidate dictionary name collide with another own dictionary?
|
||||
router.get(
|
||||
'/check-name-collision',
|
||||
user.isAuthenticated,
|
||||
dictionaries.checkNameCollision
|
||||
)
|
||||
|
||||
// Send a message to all users with a role on the given dictionary.
|
||||
router.post(
|
||||
'/:dictionaryId/contact-authors',
|
||||
user.isAuthenticated,
|
||||
dictionaries.contactDictionaryAuthors
|
||||
)
|
||||
|
||||
// Change page in pagination
|
||||
router.get(
|
||||
'/:dictionaryId/listDomainLabels',
|
||||
@@ -76,6 +97,13 @@ router.post(
|
||||
dictionaries.exportBegin
|
||||
)
|
||||
|
||||
// Delete a specific dictionary export.
|
||||
router.delete(
|
||||
'/:dictionaryId/export/:exportId',
|
||||
user.canContentEdit,
|
||||
dictionaries.deleteExport
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/:dictionaryId/domainLabels',
|
||||
user.canContentEdit,
|
||||
|
||||
@@ -17,6 +17,7 @@ const {
|
||||
// All further routes are only available to authenticated users with dictionary content editing rights.
|
||||
router.use(user.isAuthenticated)
|
||||
router.use('/delete-entry', setDerivedDictionaryIdFromEntryId)
|
||||
router.use('/:entryId/version-snapshots', setDerivedDictionaryIdFromEntryId)
|
||||
router.use(user.canContentEdit)
|
||||
|
||||
// Render entry data for the selected entry
|
||||
|
||||
@@ -2,6 +2,7 @@ const router = require('express-promise-router')()
|
||||
const user = require('../../../controllers/users')
|
||||
const users = require('../../../controllers/api/v1/users')
|
||||
const userAuth = require('../../../middleware/user')
|
||||
const oidc = require('../../../controllers/oidc')
|
||||
|
||||
// Validate and create a new user.
|
||||
router.post('/register', user.register)
|
||||
@@ -15,6 +16,13 @@ router.post('/reset-password-init', user.generateResetPasswordToken)
|
||||
// Validate new passwords, change if successful and sign the user in.
|
||||
router.post('/reset-password-submit', user.changePassword)
|
||||
|
||||
// Create a brand-new SSO account from the session-stored IdP claims, and sign the user in.
|
||||
router.post('/create-profile', oidc.createProfileSubmit)
|
||||
|
||||
// Confirm the matched local account's password, then permanently convert it into an SSO-only
|
||||
// account (IdP-derived name/username, local password removed).
|
||||
router.post('/convert-account', oidc.convertAccountSubmit)
|
||||
|
||||
// Find user by username or email in dictionary or admin console.
|
||||
router.get(
|
||||
'/addUser',
|
||||
@@ -41,6 +49,11 @@ router.post('/basic-data', users.updateBasicData)
|
||||
router.post('/password', users.updatePassword)
|
||||
|
||||
// Delete user profile of the requesting user.
|
||||
// TODO This route has no explicit isAuthenticated middleware, unlike the admin-only routes above
|
||||
// - it relies entirely on req.user.id throwing inside the controller when req.user is undefined,
|
||||
// which surfaces as an unhandled 500 rather than a clean 401/403 (see the general API-auth TODO
|
||||
// in routes/api/index.js). Since this endpoint permanently destroys account data, it deserves an
|
||||
// explicit auth check of its own rather than an implicit crash-as-guard.
|
||||
router.delete('/current', users.deleteCurrent)
|
||||
|
||||
module.exports = router
|
||||
|
||||
Reference in New Issue
Block a user