nuxt-auth icon indicating copy to clipboard operation
nuxt-auth copied to clipboard

feat: Add support for custom refresh handling

Open blumewas opened this issue 11 months ago โ€ข 0 comments

๐Ÿ”— Linked issue

Issue #714

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [x] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [x] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

The current behaviour for refreshing the users tokens does not provide many options for me as developer. As a developer I would like to be able to extend or customize this behaviour.

This PR:

  • adds new types RefreshHandler and RefreshHandlerConfig
  • adds the possibility to configure a custom RefreshHandler via refreshHandler? property to auth.session
  • extracts the default refreshing behaviour to a separate file

๐Ÿ“ Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have added tests (if possible).
  • [ ] I have updated the documentation accordingly.

blumewas avatar Mar 17 '24 13:03 blumewas