0

I am doing an $.ajax post command and i currently have an authenticated session on the client side. I am trying to figure out how to add the token to the ajax call (as on the server i check the token to see if it matches in my local database. How is it possible to use that same auth token in a generic ajax call ?

Thanks

user3554230
  • 283
  • 2
  • 11

1 Answers1

0

You add the token as a request header in your authorizer.

To do this, either use one of the including solutions (if you're using the corresponding backend), or implement your own custom authorizer.

If you have to write your own, you can look at the devise authorizer's authorize method for an example of how to add the header.

Sam Selikoff
  • 12,366
  • 13
  • 58
  • 104