nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
929 stars 194 forks source link

@nuxtjs/apollo caches the private user data on the server. #583

Closed Iran-110 closed 6 months ago

Iran-110 commented 6 months ago

Environment

Nuxt project info:

Describe the bug

After each app:render hook on the server, the plugin caches the data in the nuxtApp.payload.data[key] in these lines and restore it on the client.

So, if a user retrieves his private information once, another user can fetch it even without logging in.

Expected behaviour

Two probable recommendations:

  1. The server should cache the data for each user, separately.
  2. Or, the server just saves the public information.

Reproduction

No response

Additional context

No response

Logs

No response

Iran-110 commented 6 months ago

After hours of checking I found out that it is from the setting of @apollo/server in the API server and not nuxt.