"Object not found." instead of "Insufficient auth." when using master key (#5133)
* add additional isMaster check * adding some tests * nits * covering all basis
This commit is contained in:
committed by
Florent Vilmart
parent
de79b70cbc
commit
961abda4eb
@@ -250,9 +250,13 @@ function update(config, auth, className, restWhere, restObject, clientSDK) {
|
||||
});
|
||||
}
|
||||
|
||||
function handleSessionMissingError(error, className) {
|
||||
function handleSessionMissingError(error, className, auth) {
|
||||
// If we're trying to update a user without / with bad session token
|
||||
if (className === '_User' && error.code === Parse.Error.OBJECT_NOT_FOUND) {
|
||||
if (
|
||||
className === '_User' &&
|
||||
error.code === Parse.Error.OBJECT_NOT_FOUND &&
|
||||
!auth.isMaster
|
||||
) {
|
||||
throw new Parse.Error(Parse.Error.SESSION_MISSING, 'Insufficient auth.');
|
||||
}
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user