logto-io / js

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

feat(sveltekit): add support for custom storage and getUserInfo error handling #727

Closed simeng-li closed 5 months ago

simeng-li commented 5 months ago

Summary

introduce custom local storage support and error handling for getUserInfo

  1. Introduce a new storage option in hookConfig that allows a custom local storage to be passed into logtoClient. This will supersede the default CookieStorage for storing session and token data. If a custom storage is provided, the cookieConfig settings can be disregarded.

  2. Add a new onGetUserInfoError callback in hookConfig for custom error handling when getUserInfo or getIdTokenClaims operations fail. By default, a 500 server error will be thrown.

This PR will address the following feedbacks from the Logto community:

Testing

test lcoally

Checklist