nextjs-firebase-authentication icon indicating copy to clipboard operation
nextjs-firebase-authentication copied to clipboard

Looking for user in session cookie for each field resolved?

Open SylvainGarrigues opened this issue 5 years ago • 1 comments

Hello,

As far as I understand, the meMiddleware function makes Firebase look for the user based on the token provided in the session cookie.

As a middleware, it is executed for every field of the GraphQL request: isn't it overkill, couldn't it be done only once in the context when instantiating ApolloServer?

SylvainGarrigues avatar Oct 22 '20 15:10 SylvainGarrigues

Basically, I don't understand why you switched to a middleware in https://github.com/rwieruch/nextjs-firebase-authentication/commit/c9adeaa626541c2a02a370457542f9412d81492f What are the advantages?

SylvainGarrigues avatar Oct 22 '20 16:10 SylvainGarrigues