Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Runtime Error receiving token errors #3

Open
Alfareiza opened this issue Mar 24, 2024 · 0 comments
Open

Unhandled Runtime Error receiving token errors #3

Alfareiza opened this issue Mar 24, 2024 · 0 comments

Comments

@Alfareiza
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant