CJVT updates August and September 2026
This commit is contained in:
@@ -34,6 +34,17 @@ users.updateHitsPerPage = async (req, res) => {
|
||||
}
|
||||
|
||||
users.updateBasicData = async (req, res) => {
|
||||
if (req.user.isSso) {
|
||||
const err = Error(
|
||||
req.t(
|
||||
'Ta uporabniški račun je bil ustvarjen prek prijave z Univerzo v Ljubljani, zato osebnih podatkov ni mogoče spreminjati na portalu.'
|
||||
)
|
||||
)
|
||||
err.status = 403
|
||||
err.displayInProd = true
|
||||
throw err
|
||||
}
|
||||
|
||||
const { firstName, lastName, email: newEmail } = req.body
|
||||
|
||||
// TODO Validation (valid email format, ...).
|
||||
@@ -121,6 +132,12 @@ users.updatePassword = async (req, res) => {
|
||||
}
|
||||
|
||||
users.deleteCurrent = [
|
||||
// TODO This permanently anonymizes/closes the account with no re-authentication step - the
|
||||
// client-side confirmation modal (public/javascripts/profile-scripts.js) is the only gate, and
|
||||
// it's identical for local and SSO accounts (no password re-entry, no IdP reauth). Anyone with
|
||||
// an active/hijacked session (e.g. an unattended logged-in browser) can delete the account
|
||||
// outright. Consider requiring password re-entry for local accounts, and an equivalent reauth
|
||||
// step for SSO accounts, before calling closeAccount.
|
||||
async (req, res, next) => {
|
||||
await User.closeAccount(req.user.id)
|
||||
next()
|
||||
|
||||
Reference in New Issue
Block a user