MM-17100 setCSRFFromCookie with subpath support (#3040)
This commit is contained in:
parent
5c4405278b
commit
14421ba8e9
1 changed files with 1 additions and 2 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
import {Client4} from 'mattermost-redux/client';
|
||||
import CookieManager from 'react-native-cookies';
|
||||
import urlParse from 'url-parse';
|
||||
|
||||
let mfaPreflightDone = false;
|
||||
|
||||
|
|
@ -17,7 +16,7 @@ export function getMfaPreflightDone() {
|
|||
|
||||
export function setCSRFFromCookie(url) {
|
||||
return new Promise((resolve) => {
|
||||
CookieManager.get(urlParse(url).origin, false).then((res) => {
|
||||
CookieManager.get(url, false).then((res) => {
|
||||
const token = res.MMCSRF;
|
||||
if (token) {
|
||||
Client4.setCSRF(token?.value || token);
|
||||
|
|
|
|||
Loading…
Reference in a new issue