Axios-module: Broken server side request with cookies in 5.12.2

Created on 28 Aug 2020  路  14Comments  路  Source: nuxt-community/axios-module

After upgrading from 5.12.1 to 5.12.2 a server side axios request seems like does not send the original request cookies. proxyHeaders is tuned on and it seems to work so I think it is a breaking change in axios itself. 5.12.1 used axios 0.19.2 but 5.12.2 uses axios 0.20.0 and it has a lot of changes https://github.com/axios/axios/compare/v0.19.2...v0.20.0

Most helpful comment

Issue finally solved by v5.12.4. Special thanks again @1ed for making issue and helping for reproduction <3

All 14 comments

+1

+1

Is it connected with #428 ? Will it fix the issue?

Was anyone able to find a workaround? I tried downgrading to 5.12.1... no luck. I made sure axios 0.19.2 was the only version installed.

Hi. I made PR #452 for fix but still need a reproduction. Seems headers passing from client, are properly proxified to API inside asyncData. Would be nice if can help to make reproduction because otherwise cannot fix...

@pi0
Hi I have made a repo to reproduce it correctly you can check it here just go through the readme
https://github.com/msonowal/nuxt-auth-411

Let me know if you need anything

Thanks @msonowal that would be helpful i will try. Yet to fix issue in axios-module, we need bare minimum reproduction without depending on auth module. Taking above diff into account, must suspicious change in axios that broken auth, was https://github.com/axios/axios/pull/1845 which if in auth module, we try to set cookie headers to null, original proxified ones will be discarded.

I have just added a minimal reproducer https://github.com/nuxt-community/axios-module/pull/452#pullrequestreview-550984666

Issue finally solved by v5.12.4. Special thanks again @1ed for making issue and helping for reproduction <3

Thanks for your great work!

Thank you so much @pi0. I've already tested and pushed this change into production. Can confirm it has fixed a lot of strange issues we were having.

Same here, after updating to the latest version (5.12.5), auth module issues from SSR are now fixed

Was this page helpful?
0 / 5 - 0 ratings