fetch: Getting cookies from fetch response
问题 I'm trying to implement client login using fetch on react. I'm using passport for authentication. The reason I'm using fetch and not regular form.submit() , is because I want to be able to recieve error messages from my express server, like: "username or password is wrong" . I know that passport can send back messages using flash messages, but flash requires sessions and I would like to avoid them. This is my code: fetch('/login/local', { method: 'POST', headers: { Accept: 'application/json',