File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/runtime/composables/authjs Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -184,9 +184,14 @@ const getSession: GetSessionFunc<SessionData> = async (getSessionOptions) => {
184184 // Add any new cookie to the server-side event for it to be present on the app-side after
185185 // initial load, see sidebase/nuxt-auth/issues/200 for more information.
186186 if ( process . server ) {
187- const setCookieValue = response . headers . get ( 'set-cookie' )
188- if ( setCookieValue && nuxt . ssrContext ) {
189- appendHeader ( nuxt . ssrContext . event , 'set-cookie' , setCookieValue )
187+ const setCookieValues = response . headers . getSetCookie ? response . headers . getSetCookie ( ) : [ response . headers . get ( 'set-cookie' ) ]
188+ if ( setCookieValues && nuxt . ssrContext ) {
189+ for ( const value of setCookieValues ) {
190+ if ( ! value ) {
191+ continue
192+ }
193+ appendHeader ( nuxt . ssrContext . event , 'set-cookie' , value )
194+ }
190195 }
191196 }
192197
You can’t perform that action at this time.
0 commit comments