Websocket auth, pass access token in gke configs

This commit is contained in:
Hristo 2024-05-10 19:32:35 -04:00
parent 4e20c4ac56
commit c56a058a74
6 changed files with 49 additions and 11 deletions

View file

@ -24,14 +24,14 @@ export const formatTimeDifference = (date1: Date, date2: Date): string => {
export const clientFetch = async (path: string, payload: any): Promise<any> => {
let headers = payload.headers;
const url = `${getBackendURL()}${path}`;
const secret_token = getAccessKey();
const secretToken = getAccessKey();
if (secret_token) {
if (secretToken) {
if (headers == null) {
headers = {};
};
headers['Authorization'] = `Bearer ${secret_token}`;
headers['Authorization'] = `Bearer ${secretToken}`;
payload.headers = headers;
};