How is on-cuba-token-expired="_handleTokenExpired" working?

According to the documentation, if I define a time in = 300, “300 seconds”. in, the event from the web component app-cuba call on-cuba-token-expired will execute the method _handleTokenExpired when 300 seconds was passing, right!!!

in the follow example it will jump the alert(‘token Expired’) after 300 seconds into the app. . . . . I don´t know why but it isn´t working. . . . . some one can tell me something about it. . . thank a lot!







This handler will be invoked when Unauthorized 401 error received from REST API in response to some explicit request. There is no ping / keep alive mechanism which automatically will call this handler.

Hi Vlad,

ok, if I define = 180, after this time I am going to recive a Unauthorized 401 error when I try to use REST API?. . . . . can I say token Expiration Time is gonna be 180 seconds and can I say this like " = 180?

I have missed something or there are something wrong in my . . .


thanks a lot!!

That is correct. Your also looks fine.

Are you sure you send the token? (It happens automatically if you use cuba-rest-js / data components).
Also you have rest anonymous mode enabled so if you do not login you’ll never get 401.

1 Like


My problem is over!!!. . . . everything is really clear to me due to your explanation, you have helped me a lot.

I really appreciated it!!!