Configurable CORS credentials (#456)
* Configurable CORS credentials * update readme
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
} from "react-admin";
|
||||
|
||||
import { returnMXID } from "../utils/mxid";
|
||||
import { GetConfig } from "../utils/config";
|
||||
import { MatrixError, displayError } from "../utils/error";
|
||||
|
||||
const CACHED_MANY_REF: Record<string, any> = {};
|
||||
@@ -22,6 +23,7 @@ const CACHED_MANY_REF: Record<string, any> = {};
|
||||
const jsonClient = async (url: string, options: Options = {}) => {
|
||||
const token = localStorage.getItem("access_token");
|
||||
console.log("httpClient " + url);
|
||||
options.credentials = GetConfig().corsCredentials;
|
||||
if (token !== null) {
|
||||
options.user = {
|
||||
authenticated: true,
|
||||
|
||||
Reference in New Issue
Block a user