Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

Server crashes when authenticating with Socket.io transport and no user entity service exists #526

@compwright

Description

@compwright

Steps to reproduce

  1. Create a FeathersJS app which authenticates as follows:
    • Authenticate with feathers-authentication-jwt
    • Do NOT provide a users service, and leave authentication.service and authentication.path blank in the config file
    • Pass feathers-authentication-jwt a custom verifier that does not rely on any users service
  2. Create a FeathersJS client which authenticates as follows:
    • Authenticate with feathers-authentication-client
    • Use the feathers-socketio client transport
  3. Attempt to authenticate from the browser client with the jwt strategy

Expected behavior

A connection should be established and authenticated

Actual behavior

The server crashes with the following error:

  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/storage::find' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/storage::get' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/storage::create' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/storage::update' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/storage::patch' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/storage::remove' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/authentication::create' +1ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/authentication::remove' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/config::find' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/events::find' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/events::get' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/events::create' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/events::update' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/events::patch' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/events::remove' +0ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/availability::find' +1ms
  feathers-socket-commons:methods Setting up socket listener for event '58e2a3047463f61e5de6dbd6/api/availability::create' +0ms
/Users/jhill/Development/livescheduler/node_modules/feathers-authentication/lib/socket/handler.js:193
      entityService.on('updated', _updateEntity2.default);
                   ^

TypeError: Cannot read property 'on' of undefined
    at Namespace.<anonymous> (/Users/jhill/Development/livescheduler/node_modules/feathers-authentication/lib/socket/handler.js:193:20)
    at emitOne (events.js:101:20)
    at Namespace.emit (events.js:191:7)
    at Namespace.emit (/Users/jhill/Development/livescheduler/node_modules/socket.io/lib/namespace.js:212:10)
    at /Users/jhill/Development/livescheduler/node_modules/socket.io/lib/namespace.js:180:14
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

System configuration

Module versions:

  • feathers v2.1.3
  • feathers-authentication v1.2.4
  • feathers-authentication-client v0.3.2
  • feathers-authentication-hooks v0.1.4
  • feathers-authentication-jwt v0.3.1
  • feathers-hooks v2.0.1
  • feathers-socketio v2.0.0
  • socket.io-client v2.0.3

NodeJS version: v7.9.0

Operating System: Mac OS X

Browser Version: Chrome v58.0.3029.110 (64-bit)

Module Loader: Webpack v2.2.1

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