I have integrated sanctum for API authentication. I was facing a problem of redirection if the token
is unauthenticated and solved it using this answer on laracasts
I could get a JSON response like:
{
"message": "Unauthenticated."
}
What I am trying to do is to handle this response to be something like:
{
"status_code": 401,
"success":false,
"message": "Unauthenticated."
}
Thanks in advance ^^