Commit bac61fd0 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(feat): Pass Pro Domain headers on every request

1 merge request!528WIP: (feat): Minds Pro
Pipeline #81913159 failed with stages
in 5 minutes and 19 seconds
......@@ -202,17 +202,20 @@ export class Client {
private buildOptions(options: Object) {
const XSRF_TOKEN = this.cookie.get('XSRF-TOKEN') || '';
const headers = new HttpHeaders({
const headers = {
'X-XSRF-TOKEN': XSRF_TOKEN,
'X-VERSION': environment.version,
});
};
if (this.origin) {
const PRO_XSRF_JWT = this.cookie.get('PRO-XSRF-JWT') || '';
headers['X-MINDS-ORIGIN'] = this.origin;
headers['X-PRO-XSRF-JWT'] = PRO_XSRF_JWT;
}
const builtOptions = {
headers: headers,
headers: new HttpHeaders(headers),
cache: true,
};
......
......@@ -79,8 +79,12 @@ export class Upload {
xhr.setRequestHeader('X-XSRF-TOKEN', XSRF_TOKEN);
if (this.origin) {
xhr.setRequestHeader('X-MINDS-ORIGIN', this.origin);
const PRO_XSRF_JWT = this.cookie.get('PRO-XSRF-JWT') || '';
xhr.withCredentials = true;
xhr.setRequestHeader('X-MINDS-ORIGIN', this.origin);
xhr.setRequestHeader('X-PRO-XSRF-JWT', PRO_XSRF_JWT);
}
xhr.send(formData);
......
<?php
$meta = Minds\Core\SEO\Manager::get();
$pro = Minds\Core\Di\Di::_()->get('Pro\Domain')->lookup($_SERVER['HTTP_HOST'] ?? null);
?>
<?php
if (!defined('__MINDS_CONTEXT__')) {
define('__MINDS_CONTEXT__', 'app');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment