Level 122
i would create a service and store the authentication token in cache, in line with its expected validity
This assumes that the token is for the service and not for the specific user that submitted the form
Not a job for middleware
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have some post routes that requires some kind of authentication and the flow is:
now what is the best way to do this. because I have some scenarios in my mind:
i would create a service and store the authentication token in cache, in line with its expected validity
This assumes that the token is for the service and not for the specific user that submitted the form
Not a job for middleware
Please or to participate in this conversation.