How can I set the up.protocol.config.crsfHeader

39 views
Skip to first unread message

Gustavo Gawryszewski

unread,
Apr 20, 2021, 2:29:47 PM4/20/21
to unpoly
I've tried to set using the meta tags and defining after loading unpoly but none has worked. Do you have an example of this working?

Thanks,
Gustavo

Gustavo Gawryszewski

unread,
Apr 21, 2021, 4:41:44 PM4/21/21
to unpoly
I've managed to find the answer looking at the code.

In case someone has the same need:

up.protocol.config.csrfHeader = "X-CSRFToken"; // Setting the variable will change the default CSRF header
up.protocol.csrfToken();  // Calling this will get the token from the meta tag as described on the docs
up.protocol.csrfParam(); // Calling this will get the param from the meta tag as described on the docs

Reply all
Reply to author
Forward
0 new messages