[Seaside] Re: Seaside, JWT and REST

Paul DeBruicker pdebruic at gmail.com
Wed Oct 21 20:44:53 UTC 2015


There is the JQAjaxSetup>>#onBeforeSend: method and you'd use it like:


html anchor
       url:'javascript(0);',
       onClick: (html jQuery ajax 
                                  callback: [self processCallBack]; 
                                  onBeforeSend:(JSStream on: ('if
($window.sessionStorage.token) {
           xhr.setRequestHeader("Authorization", "Bearer " +
$window.sessionStorage.token);} ' asFunction: #('xhr')));
       with: 'do the thing'.


Beware that's in email client code so may not work exactly but you get the
gist of it I think.



SebastianHC wrote
> 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?

> 
> 
> 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
>> 

> seaside at .squeakfoundation

>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
> 
> _______________________________________________
> seaside mailing list

> seaside at .squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
View this message in context: http://forum.world.st/Seaside-JWT-and-REST-tp4857137p4857153.html
Sent from the Seaside General mailing list archive at Nabble.com.


More information about the seaside mailing list