-
Notifications
You must be signed in to change notification settings - Fork 98
Setting up authManagement in Nuxt.js gives not authenticated error (feathers-vuex) #93
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
Comments
I don't use Vue so I can't help. Perhaps you can ask @marshallswain who wrote feathers-vuex (called Marshall on Feathers Slack). |
It seems that even though you are setting up the feathers client with the cookie storage module, the JWT is still not available to the feathers client as a cookie in the server environment. Hence, the error I recommend using a debugger to set a breakpoint in your feathers-client.js so you can see if you can get access to the cookie in that context. I wrote an article on debugging Nuxt that might still be helpful even though I wrote it for a Nuxt beta release. https://codeburst.io/debugging-nuxt-js-with-visual-studio-code-724920140b8f If you'd like to push your code to GitHub, I'd be glad to pull and troubleshoot. |
Just pushed some code to a repo here I have a hard time debugging this, since I haven't been coding that long and this is all pretty new to me. Really appreciate you taking a look. |
@marshallswain really rookie mistake. I forgot to set the cookie to enabled on server side. Server side error is fixed. The one on the client ("An id must be provided to the 'patch' method") persists. I will look into that later. |
Ok just tried it again with an axios post request instead. This works flawlessly. So what I still don't understand is why I have to provide an id to the patch method when I can just send a post request to the /authmanagement endpoint without any ids. Obviously this is something I can code around. I just don't get it. |
Ok, I feel this is off topic here. I'll close the issue. Thanks for the help so far :). |
I am trying to implement the authManagement module in a Vue frontend (Nuxt.js) but I can't get it to work.
Steps to reproduce
User flow:
{action: action, value:token}
object. (In my mind the same as sending a post request to the /authManagement endpointExpected behavior
The user is authenticated and posting the token verifies the user
Actual behavior
Server side error message (I think on dispatching auth/authenticate):
Client side error message (set as createError on the authManagement state):
What I don't understand
Shouldn't the userid of the verification action be taken from the token?
Why is my cookie not recognized?
Is there anything I am missing?
I will happily contribute to the Vue docs if I get this working
Code
feathers.js in plugins (client)
Vuex store index.js
script in verify.vue
The text was updated successfully, but these errors were encountered: