8000 Messages not received by client after `authenticate` hook. · Issue #1671 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

Messages not received by client after authenticate hook. #1671

@bartram

Description

@bartram

Using feathersjs in a react-native project, running the authenticate hook appears to cause context to lose the reference to the socket connection, so it is not possible for that connection to join channels in subsequent hooks (or in the service functions themselves), and events are not received by the client. I've narrowed it down the cause of my issue to the line below:

context.params = merge({}, params, omit(authResult, 'accessToken'), { authenticated: true });

Passing params as the first argument of merge (and getting rid of the empty object, thus mutating params instead of copying it) solves the issue in my case:

context.params = merge(params, omit(authResult, "accessToken"), {
  authenticated: true
});
< 639C /div>

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