Skip to content
This repository was archived by the owner on Jul 3, 2026. It is now read-only.
This repository was archived by the owner on Jul 3, 2026. It is now read-only.

401 improvement #95

Open
Open

Description

@smebberson

Describe the problem you'd like to have solved

I'd like to improve the integration of this library when it comes to 401 responses.

Describe the ideal solution

The README clearly states that The idea is that you will use another mechanism to validate the user first.

However, I think that return res.send(401); should be updated to actually call a default function. Then when configuring this library via auth, you can pass in a function to override the default handling.

This is line with how the library works when it comes to customising handling.

Alternatives and current work-arounds

The current work around is to have some extra middleware that runs before this one to validate the user first. However, I feel that looses a bunch of context when working with auth, and I feel that solution is more inline with how other parts of auth work.

Additional context

I'd be happy to provide a PR if this is something you're interested in.

Activity

  1. luuuis commented on Oct 22, 2020

    @luuuis
    Contributor

    Related to #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions