Closed andreassavva closed 7 years ago
In the end I've figured it out. In router.js
I set credentials: 'same-origin'
in the fetch()
method. It looks like this:
return fetch(url, { method, credentials: 'same-origin' }).then(resp => resp.json());
According to this, fetch
does not send cookies unless explicitly instructed to.
I have an
HttpGet
method inHomeController
which requires authorization with the[Authorize]
attribute. I have created a custom authentication like this. I worked it out so it authorizes the user correctly, but theUser
attribute isnull
in the GET methods inroutes.json
:Am I doing something wrong? How do I fix this?