mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
user should be able to change the temprary password (#407)
Refer to https://github.com/jambonz/jambonz-api-server/issues/406
This commit is contained in:
@@ -33,6 +33,10 @@ function verifyViewOnlyUser(req, res, next) {
|
|||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
// current user is changing their password which shuould be allowed
|
||||||
|
if (req.body?.old_password && req.body?.new_password) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
// Check if user is read-only
|
// Check if user is read-only
|
||||||
if (req.user && !!req.user.is_view_only) {
|
if (req.user && !!req.user.is_view_only) {
|
||||||
const upError = new UserPermissionError('User has view-only access');
|
const upError = new UserPermissionError('User has view-only access');
|
||||||
|
|||||||
Reference in New Issue
Block a user