Re: Seaside, JWT and REST

Sebastian Heidbrink <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
Okay,

I found some information that would at least give me a chance to not add 
additional load to my seaside server.
But unfortunately I can not find any documentation on the "ajax 
beforeSend" topic in Seaside's history.

How do I implement the "beforeSend" part of this script in Seaside?

<script type='text/javascript'>
// define vars
var url = 'https://...';

// ajax call
$.ajax({
     url: url,
     dataType : 'jsonp',
     beforeSend : function(xhr) {
       // set header if JWT is set
       if ($window.sessionStorage.token) {
           xhr.setRequestHeader("Authorization", "Bearer " + 
$window.sessionStorage.token);
       }

     },
     error : function() {
       // error handler
     },
     success: function(data) {
         // success handler
     }
});
</script>


Thank you!
Sebastian




Am 21.10.2015 um 11:26 schrieb Sebastian Heidbrink:
> Hi!
>
> I have a working JWT (JsonWebToken) protected Zinc based REST server.
> I do also have a Seaside server as a user platform.
>
> Now I would like to integrate some results of the REST interfaces of 
> the Zinc based server into my seaside frontend.
> How would I define an ajax call including a JWT token in Seaside that 
> populates a table rendered by seaside on/after page load?
>
> Thank you for any ideas!
> Sebastian
> _______________________________________________
> seaside mailing list
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.