did anyone run into issues with authenticating sub...
# prisma-whats-new
d
did anyone run into issues with authenticating subscriptions? regular query works, but same set of data through subscription is failing with
Insufficient Permission
(I have permissions set to require authentication) I have subscription client initialized like this
Copy code
const wsClient = new SubscriptionClient(ENDPOINT_SUBSCRIPTIONS, {
    reconnect: true,
    timeout: 30000,
    connectionParams() {
      if (authStore.authUser) {
        return { authToken: authStore.authUser.token }
      }
      return null
    },
  })
However, the function is called once at the start of my app when I don't have token yet
a
You should reinitialize the subscription client after authentication, that's the safest way, also to prevent the newly logged in user to get subscription results from the previous user.