adzhurinskij/phpipam-client

token expiry time is ignored

Closed this issue · 2 comments

Hi,

the auth response returns

{"code":200,"success":true,"data":{"token":".J1e9ipFZkPE6EvIRAqEf9hp","expires":"2017-01-05 14:18:43"},"time":0.009}

the expiration time is not handled.

There are possible solutions

  • to extend token if close to expiration on any call
  • to relogin after expiration

I have got long running process and the session expires in meanwhile.

I decided to handle i in my code.
All Ineed to cal login function after instance create to get the expiry time. That means I call login() twice, once during instance creation, second time to get expiry time.