Skip to content

Commit cbe4c83

Browse files
committed
pkp/pkp-lib#12606 cross tab updated csrf handing
1 parent ce77c6b commit cbe4c83

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/composables/useFetch.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ let ofetchInstance = ofetch;
1111
export function getCSRFToken() {
1212
const FALLBACK_TOKEN = 'test_csrf_token';
1313

14+
if (typeof pkp !== 'undefined' && typeof pkp.getCsrfToken === 'function') {
15+
return pkp.getCsrfToken() || FALLBACK_TOKEN;
16+
}
17+
1418
if (typeof pkp !== 'undefined') {
1519
return pkp?.currentUser?.csrfToken || FALLBACK_TOKEN;
1620
}

0 commit comments

Comments
 (0)