I am working with Node js and Front-end on Next JS, I have a grahphQL serve with GetUrl method, this method returns a link (example: "https://some-line.com") and I want to redirect a client which made a request to that page with Basic Auth Header, As far as I know In graphql server it is impossible to make a redirect, I have tried to solve this issue on front With React-router package, I made this (Router.push("https://some-line.com) It works but, how to set header?
Asked
Active
Viewed 463 times
0
-
I don't know about graphQL but it's impossible with react you will have to use vanilla js check this https://stackoverflow.com/questions/7583461/redirect-to-page-and-send-custom-http-headers/41218304#41218304 – evgeni fotia Mar 18 '19 at 11:56
1 Answers
0
You can use window.location
to redirect. But its impossible in any framework to set a customer header before redirecting. You might want to redesign your logic.

GRS
- 1,829
- 1
- 9
- 23