Skip to content

Feathers auth client does not treat non-401 failures as failures #1787

@jnardone

Description

@jnardone

If you have an existing JWT, when an initial reAuthenticate call happens, if the referenced entity does not exist any more (e.g. deleted from users) then the feathers client does not handle this as a failure and no response is delivered to the caller.

We hit this in some tests, but it's easy enough if you either remove the test user from the users collection or supply a JWT with an invalid user ID/sub reference.

I can make this succeed if I change jwt.ts to:

-    const result = await entityService.get(id, omit(params, 'provider'));
+    try {
+      const result = await entityService.get(id, omit(params, 'provider'));
+    } catch(err) {
+      throw new NotAuthenticated(`Could not find entity`);
+    }

but I'm not advocating this as a specific approach. The client is clearly not looking for a 404 to come back, but that's what gets delivered back to the feathers authentication client.

Node 12.14
Feathers 4.4.3 (server and client)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions