E40C feathers auth assumes an accessToken exists for socket (regression) · Issue #1568 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

feathers auth assumes an accessToken exists for socket (regression) #1568

@jnardone

Description

@jnardone

Prior to 2707c33#diff-847cf0caf6782a09a6a9cf0969d02f50R35 in 4.3.0 you could (in an after hook) remove the accessToken from hook.result in an after hook. We are doing this to enforce a 2fa flow in our application, to request further info in a future auth request. We however still wanted to return a 20x response code with the request.

With the above the code assumes there is an access token in the result, and throws an ugly "jwt must be provided" error in this situation.

Is it reasonable to assume that a successful call to authenticate always includes an accessToken, and we need to rethink our design? Or should this socket code check for accessToken existence prior to running this block of code?

We could return an error in this case if that's our only option.

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

      0