Hi,
I'm using a prehandler in my API call similar to the one in the example here:
https://coldbox.ortusbooks.com/digging-deeper/recipes/building-rest-apis
My API is set up the same way as the examples in the link above.
The prehandler does not prevent the index handler from executing despite failing user auth.
<cffunction name="preHandler" output="false" hint="preHandler">
<cfargument name="event">
<cfargument name="rc">
<cfargument name="prc">
<cfargument name="action">
<cfargument name="eventArguments">
[my code removed but confirmed working]
<cfif ! FALSE>
<cfset event.renderData( type="json", data={data}, statusCode=403, statusMessage="not authorized") />
</cfif>
</cffunction>
<cffunction name="index" returntype="void" output="false" hint="customer at risk list">
<cfargument name="event">
<cfargument name="rc">
<cfargument name="prc">
[my stuff}
<cfset event.renderData( type="json", data=local.response, statusCode=local.response["statuscode"], statusMessage=local.response["message"]) />
</cffunction>
How can the prehandler stop the index method from firing?