Handle token

This commit is contained in:
Owen 2025-08-13 17:30:59 -07:00
parent 2c8bf4f18c
commit dc50190dc3
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
7 changed files with 232 additions and 83 deletions

View file

@ -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