Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookie is sent only to my localhost http api, but not to my productive api running on https #45

tobkle opened this issue Oct 14, 2017 · 2 comments


None yet
2 participants
Copy link

commented Oct 14, 2017

Calling my development microservices with http://localhost/api the credentials cookies are sent. Setting it to production to run against https://api.server/api it doesn't send the cookies any more.

First I thought it was due to this, but by deactivating it in "plugin.template.js" it is still not working:

  axios.interceptors.request.use(config => {
    // if (config.withCredentials === undefined) {
      // if (!/^https?:\/\//i.test(config.url) || config.url.indexOf(baseURL) === 0) {
        config.withCredentials = true
      // }
    // }
    return config

Can anyone give me a hint how you are calling your microservices api?

This question is available on Nuxt.js community (#c42)

This comment has been minimized.

Copy link

commented Oct 14, 2017

Hi. While my answer would not be exactly your question, but i HIGHLY recommend using proxy module for your microservice deployments as it resolves problems with credentials and CORS. A little guide on usage is at the end of docs.

About your question: I think CORS header should be enabled to make XHR working ...


This comment has been minimized.

Copy link

commented Oct 14, 2017

Thanks for your fast valuable hint. It works with the following setup:


modules: [

axios: {},

proxy: {
    '/api': ''

Starting nuxt:
nuxt:axios BaseURL: http://localhost:3333/api (Browser: /api) +0ms
[HPM] Proxy created: /api ->

'/api/auth/login' results now into ''

Cookies are transferred as expected.

@tobkle tobkle closed this Oct 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.