I developed a spring boot api using jwt auth and I got the endpoint
'http://localhost:8080/api/signin'
If the login is successful, it will return a JSESSIONID, which is a jwtToken. So far so good, but I can get other methods from the API in the browser since the cookie is not passed in the request body.
The cookie generated by jwt is as follows: JSESSIONID=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlhdCI6MTY4NTE1Mzk5NSwiZXhwIjoxNjg1MjQwMzk1fQ.9jxHyzDJKVra8IryxbH8se0xSl4_Dka p NsKmjRCvlJs_R8M3x3RBMeo-1VPAJv6YSQwC6ukJutRwGEyfeYrGwQ;path=/;Http only;expire=Sunday, May 28, 2023 02:38:33 GMT;
For example: If I do this
1 |
|
Everything goes fine and returns the json I want, but when I run it on the browser, in the js script on my frontend
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
I get this error:
1 |
|
Cookie not set. I tried so many things and almost lost my mind. Do you know what it will be?