I am creating a simple jQuery powered application, which uses JWT
via Flask
on the back-end. I do not want to use a more feature rich client-side framework.
I can interface with the API using the token via $.ajax
such as:
$.ajax({
type: 'post',
url: '/users',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Bearer XXX")
}
});
However, I cannot interface with the 'simple' HTML pages as the GET
request does not include the Bearer
token.
If I attempt to use the same method as above, but using a GET
type, the ajax
can load the page, however the new content is not displayed in the browser (XMLHttpRequest
).
Is there a way I can access and display GET
data in the users browser using jQuery?