Skip to content

Class based HttpService prevents inclusion of useAuth values for ky 'interceptor' hooks #2

@tommyderami

Description

@tommyderami

Hey @bartstc this template has been a super helpful starting point with great structure and dependency choices. One improvement might be switching the HttpService class to a useHttpService hook with the header/host options set in the hook. This would allow the useAuth hooks to provide JWT/cookie/etc context to protected routes via their hooks API. If there isn't a strong security concern that prompted the private class elements it might make the HTTP service slightly more ergonomic. If you agree this would be a good change, I'm currently working on my own refactor that I can push as a PR if desired, although I'm sure you could write something much cleaner than my code!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions