WIP work on getting nextauth + graphql working
This commit is contained in:
parent
45f8cb1234
commit
24d52eef3d
8 changed files with 668 additions and 21 deletions
|
|
@ -4,7 +4,7 @@ export default createProxyMiddleware({
|
|||
target:
|
||||
process.env.NODE_ENV === "production"
|
||||
? "http://metamigo-api:3001"
|
||||
: "http://localhost:3001",
|
||||
: "http://127.0.0.1:3001",
|
||||
changeOrigin: true,
|
||||
pathRewrite: { "^/graphql": "/graphql" },
|
||||
xfwd: true,
|
||||
|
|
@ -20,8 +20,6 @@ export default createProxyMiddleware({
|
|||
let token = req.cookies["__Secure-next-auth.session-token"];
|
||||
if (!token) token = req.cookies["next-auth.session-token"];
|
||||
|
||||
// console.log(req.body);
|
||||
// if (req.body.query) console.log(req.body.query);
|
||||
if (token) {
|
||||
proxyReq.setHeader("authorization", `Bearer ${token}`);
|
||||
proxyReq.removeHeader("cookie");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue