logto-io / js

🤓 Logto JS SDKs.
https://docs.logto.io/quick-starts/
MIT License
67 stars 40 forks source link

fix(next): refresh cookie ttl when access token change #633

Closed wangsijie closed 8 months ago

wangsijie commented 9 months ago

Summary

When access token changed (new one issued), the session will change with new token map as well, need to set new cookie by calling "storage.save()".

No need to change "server actions" SDK because the cookie is not managed inside the SDK, and the server action can not always call "setCookie".

Testing

Local tested, after 1 hour when access token expires, "set-cookie" is found in response header.

截屏2024-02-20 下午4 59 15

Checklist