You are viewing our Forum Archives. To view or take place in current topics click here.
Is this how you get the token of a URL?
Posted:

Is this how you get the token of a URL?Posted:

Furdew
  • TTG Natural
Status: Offline
Joined: Jul 03, 201112Year Member
Posts: 978
Reputation Power: 38
Status: Offline
Joined: Jul 03, 201112Year Member
Posts: 978
Reputation Power: 38
$.ajax({
url:link,
type:'POST',
headers:{"X-CSRF-TOKEN": TokenRegex },
success:function a (data){
$.get(url).success(data)
var TokenRegex = data.match(/XsrfToken\.setToken\('(.+)'\);/);
}
})


link is already defined, just didnt paste all the code and its somewhere a few lines up :p

But basically i need to get the token of said URL, not sure if i'm doing this right.

Thats why im asking :^)
#2. Posted:
Sys
  • WIP 5.1
Status: Offline
Joined: Dec 30, 201310Year Member
Posts: 1,331
Reputation Power: 69
Status: Offline
Joined: Dec 30, 201310Year Member
Posts: 1,331
Reputation Power: 69
After a quick search I can up with this article: [ Register or Signin to view external links. ]

Don't know whether this helps, but it fits the criteria you are looking for.

-0lly
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.