slim-jwt-auth
slim-jwt-auth copied to clipboard
Calling response object from "before" callback
I'm using version 3.4 and I'm running some checks based on the decoded token in the "before" callback just after the token has been validated. The problem is that if one of the check fails, I can't return a 401 from the callback as I can't access the response object. I've seen it was possible in the previous version. Is there any way I can call the error callback from "before", halt the execution or do I need to do my checks in another middleware called after the token is validated ?
maybe you should use 'after' instead. it is intended to run after jwt checking done
'before' is also after the JWT checking. The possible problem is that other middleware have run then as well which may not be desired.
@geshub have you managed to solve that problem, do I have the same situation?