@@ -134,7 +134,7 @@ async function runFindTriggers(
134134
135135// Returns a promise for an object with optional keys 'results' and 'count'.
136136const find = async ( config , auth , className , restWhere , restOptions , clientSDK , context ) => {
137- enforceRoleSecurity ( 'find' , className , auth , config ) ;
137+ enforceRoleSecurity ( 'find' , className , auth ) ;
138138 return runFindTriggers (
139139 config ,
140140 auth ,
@@ -149,7 +149,7 @@ const find = async (config, auth, className, restWhere, restOptions, clientSDK,
149149
150150// get is just like find but only queries an objectId.
151151const get = async ( config , auth , className , objectId , restOptions , clientSDK , context ) => {
152- enforceRoleSecurity ( 'get' , className , auth , config ) ;
152+ enforceRoleSecurity ( 'get' , className , auth ) ;
153153 return runFindTriggers (
154154 config ,
155155 auth ,
@@ -172,7 +172,7 @@ function del(config, auth, className, objectId, context) {
172172 throw new Parse . Error ( Parse . Error . SESSION_MISSING , 'Insufficient auth to delete user' ) ;
173173 }
174174
175- enforceRoleSecurity ( 'delete' , className , auth , config ) ;
175+ enforceRoleSecurity ( 'delete' , className , auth ) ;
176176
177177 let inflatedObject ;
178178 let schemaController ;
@@ -257,13 +257,13 @@ function del(config, auth, className, objectId, context) {
257257 ) ;
258258 } )
259259 . catch ( error => {
260- handleSessionMissingError ( error , className , auth , config ) ;
260+ handleSessionMissingError ( error , className , auth ) ;
261261 } ) ;
262262}
263263
264264// Returns a promise for a {response, status, location} object.
265265function create ( config , auth , className , restObject , clientSDK , context ) {
266- enforceRoleSecurity ( 'create' , className , auth , config ) ;
266+ enforceRoleSecurity ( 'create' , className , auth ) ;
267267 var write = new RestWrite ( config , auth , className , null , restObject , null , clientSDK , context ) ;
268268 return write . execute ( ) ;
269269}
@@ -272,7 +272,7 @@ function create(config, auth, className, restObject, clientSDK, context) {
272272// REST API is supposed to return.
273273// Usually, this is just updatedAt.
274274function update ( config , auth , className , restWhere , restObject , clientSDK , context ) {
275- enforceRoleSecurity ( 'update' , className , auth , config ) ;
275+ enforceRoleSecurity ( 'update' , className , auth ) ;
276276
277277 return Promise . resolve ( )
278278 . then ( async ( ) => {
@@ -314,11 +314,11 @@ function update(config, auth, className, restWhere, restObject, clientSDK, conte
314314 ) . execute ( ) ;
315315 } )
316316 . catch ( error => {
317- handleSessionMissingError ( error , className , auth , config ) ;
317+ handleSessionMissingError ( error , className , auth ) ;
318318 } ) ;
319319}
320320
321- function handleSessionMissingError ( error , className , auth , config = null ) {
321+ function handleSessionMissingError ( error , className , auth ) {
322322 // If we're trying to update a user without / with bad session token
323323 if (
324324 className === '_User' &&
@@ -327,10 +327,9 @@ function handleSessionMissingError(error, className, auth, config = null) {
327327 ! auth . isMaintenance
328328 ) {
329329 const { createSanitizedError } = require ( './SecurityError' ) ;
330- const defaultLogger = require ( './logger' ) . default ;
331330 const detailedError = 'Insufficient auth.' ;
332- const log = ( config && config . loggerController ) || defaultLogger ;
333- throw createSanitizedError ( Parse . Error . SESSION_MISSING , detailedError , log ) ;
331+
332+ throw createSanitizedError ( Parse . Error . SESSION_MISSING , detailedError ) ;
334333 }
335334 throw error ;
336335}
0 commit comments