-
Notifications
You must be signed in to change notification settings - Fork 6
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
"error: NotAuthenticated: invalid signature when running local with vue.js" frontend #2
Comments
I had emailed Randy as well, and he suggested looking into the following:
|
I was able to use a fresh installation of the vue-js real world app calling a local version of the feathers-realworld-example-app without any trouble. I notice that the vue app does not seem to clear the Authorization header properly (gothinkster/vue-realworld-example-app#296 (comment)). Is it possible that a token generated by the node-express-realworld_-example-app was retained by the vue app in the Authorization header and then passed to the feathers app? This would produce the result you observed. The feathers app will return an error indicating the token is invalid (invalid signature). |
Thanks for looking into this Randy, When I tried again with BTW, I noticed that error reporting back to user on UI was not very correct, e.g. trying to login with a wrong username/password shows on UI:
The message on the server terminal is clearer however:
Do you know if this is a bug/missing feather here or on the Vue frontend? I might send a pull request to the relevant project later on to fix it. Edit: tested react now, it fails on slightly different ways. So part of the problem is definitely on the frontend. |
Thanks for checking the feathers app. Here's what I've found checking the Vue app with Feathers and Node Express. The feathers error message looks like there might be a problem in the feathers error handling because the response includes extra (redundant) stuff. The client has to grab the “errors” instead of assuming that’s all there is. Looks like this:
Should probably look like this:
However, it looks like the Vue app does grab the “errors” value properly but doesn’t handle the “body” array properly and this is why we see body [object Object].. The “body” array is in the spec: If a request fails any validations, expect a 422 and errors in the following format:
So that seems to mean that the Vue app has a problem. A further wrinkle is that the Node Express app doesn’t include the “body” array in its error response.
And that’s why the Vue app displays a better error message when calling the Node Express app. |
I first managed to get a fully working vue-js Node.js Express setup as shown at: gothinkster/node-express-realworld-example-app#116 which indicates that the Vue setup and my MongoDB are actually working.
So now I wanted to replace the Node.js Express backend with this FeathersJS backend at 8bc3a09 and I ran it with:
and patched the Vue frontend to point it to this server:
but then, when I visit the homepage at http://localhost:8080/ , the "Loading articles..." never disappears, indicating a problem, and on the server I see:
Any clues?
The text was updated successfully, but these errors were encountered: