How to use Web Guard (Cookies) with VueJS #4300
Replies: 1 comment
-
I fixed this by running my Adonis Server on http://localhost:3333 rather than http://127.0.0.1:3333. The problem with running on http://127.0.0.1:3333 was that I was send my fetch requests to localhost and cookies can not cross domains. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use Web Guard with my VueJS Application
I am able to send email and password and get a
Set-Cookie
response back from Adonis.Here is the response to hitting the login route with the correct username and password
However on future future fetch requests I get 401 Unauthorised.
Here is my controller code
Here is the error that Adonis produces.
I have set credentials to true in the fetch request.
Adonis is running on http://127.0.0.1:3333 and my VueApp is running on http://127.0.0.1:8080
Cors is enabled and origin is to "*", but I have also tried
true
Any ideas what I might be doing wrong.
Beta Was this translation helpful? Give feedback.
All reactions