mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-23 10:48:28 +02:00
Handle token
This commit is contained in:
parent
2c8bf4f18c
commit
dc50190dc3
7 changed files with 232 additions and 83 deletions
|
@ -5,6 +5,7 @@ import HttpCode from "@server/types/HttpCode";
|
|||
import createHttpError from "http-errors";
|
||||
import logger from "@server/logger";
|
||||
import config from "@server/lib/config";
|
||||
import { tokenManager } from "./tokenManager";
|
||||
|
||||
/**
|
||||
* Proxy function that forwards requests to the remote cloud server
|
||||
|
@ -28,6 +29,7 @@ export const proxyToRemote = async (
|
|||
data: req.body,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(await tokenManager.getAuthHeader()).headers
|
||||
},
|
||||
params: req.query,
|
||||
timeout: 30000, // 30 second timeout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue