gladly-team / next-firebase-auth

Simple Firebase authentication for all Next.js rendering strategies
https://nfa-example-git-v1x-gladly-team.vercel.app/
MIT License
1.33k stars 290 forks source link

Improve setAuthCookies types to no be necessary passing an empty object when not setting the token #684

Closed luiz504 closed 6 months ago

luiz504 commented 8 months ago

Following the get started documentation, the setAuthCookies function requires the req and res only, when playing this code using typescript it expects a third argument, that is a object that can receive a token property. image

I suggest to make the whole options object as optional to not be required passing a empty object when using the function without passing any options. reviewing the source code, I guest that just add a "?" to the user property on the line 16 will solve it image

kmjennison commented 6 months ago

Thanks for the issue! A fix will be out shortly.