logto-io / js

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

fix(nuxt): return undefined instead of throwing for fetch user info #739

Closed wangsijie closed 3 months ago

wangsijie commented 3 months ago

Summary

Wrap fetchUserInfo with trySafe to avoid throwing. When the token expires, this request will fail and throw an error, this error is hard to catch. Developers may check the existance of user to check if the user is authenticated.

Testing

Existing tests should pass.

Checklist