app-monorepo icon indicating copy to clipboard operation
app-monorepo copied to clipboard

[BUG]: set-cookie when making requests inside desktop client

Open socratese opened this issue 1 year ago • 2 comments

Describe the bug cannot access set-cookie headers when making any requests inside app (GET/POST/PATCH etc)

To Reproduce Steps to reproduce the behavior: tried within my service file, made a seperate one for testing purposes:

class ServiceMonitor extends ServiceBase {
  @backgroundMethod()
  async test() {
    const result = await axios.post('https://jsonplaceholder.typicode.com/posts', {
      userId: 1,
      title: 'Test Title',
      body: 'Test Body',
    });

    console.log(result.data);
  }
}```


**Expected behavior**
should be able to access set-cookie header from response 



**Desktop (please complete the following information):**
 - OS: macOS
 - Browser [e.g. chrome, safari]
 - Version [all]


**Additional context**
Add any other context about the problem here.

socratese avatar Jan 12 '24 15:01 socratese

This is the browser's security policy, you can check the httpOnly setting.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie

ByteZhang1024 avatar Jan 15 '24 03:01 ByteZhang1024

yes, I know that. im more looking for the best way to go about making these requests to get the set-cookies inside this app, I'll open a PR once done. what do you suggest?

socratese avatar Jan 15 '24 17:01 socratese