Next.js Discord

Discord Forum

Additional Header from Client using useTransition Server Action?

Answered
Red-necked Grebe posted this in #help-forum
Open in Discord
Red-necked GrebeOP
transit(async()=>{ // << can we add some kind of header here to be sent from client?
  const result = await SomeServerFunction()
})


thanks...
Answered by Red-necked Grebe
workaround now using set-cookie in middleware with filtered endpoint
View full answer

6 Replies

no i dont think thats possible. why not just send it as a function parameter?
@joulev no i dont think thats possible. why not just send it as a function parameter?
Red-necked GrebeOP
security governance over my place wont allow passing X-Signature-Verificator into params. right now im try modify the action source code in my local, hopefully found something and can change it.

but anyway i will negotiate with my secgov in my place.
and tells them "this how next works" :meow_stare: :lolsob:
ok its confirmed it cannot pass a header, solved.
but it would be nice if it can pass some header like fetch 😉
Red-necked GrebeOP
workaround now using set-cookie in middleware with filtered endpoint
Answer
Red-necked GrebeOP
:verysad: