Unhandled Runtime Error receiving token errors
Opened this issue · 0 comments
Alfareiza commented
Let's say for any reason the token wasn't found in the cookies. So, the request to the API is made without token, and sending in the header Bearer undefined
so as a result the front receive this response from the API:
{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
And this response apparently is not legible because nextjs raise the next error:
Unhandled Runtime Error
Error: Objects are not valid as a React child (found: object with keys {token_class, token_type, message}). If you meant to render a collection of children, use an array instead.
I guess the error must be solved in this line