You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
client.authenticate() should redirect to the successful login page as specified in my login.js file or display an error if authentication is unsuccessful.
Actual behavior
The feathers-client socket timeout handler is hit in both cases - on successful authentication and user not found. The response is always: "Error: Authentication timed out" after the default 5 seconds.
I see the server reply on the socket right away (in the code I'm listening for 'authenticated' and 'unauthorized' socket events for testing) with the correct response, including the token when authentication is successful. The feathers-client ignores these responses and doesn't store the token in localStorage on successful authentication.
Here are the web browser console outputs for the socket events to confirm the authentication is happening as expected on feathers server-side: Successful authentication Socket authenticated: {"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJfaWQiOiJiNFBRTllDNkZlMjlhN1ZLIiwiaWF0IjoxNDkwMTAxOTIyLCJleHAiOjE0OTAxODgzMjIsImlzcyI6ImZlYXRoZXJzIn0.Uys3gyHUDV_78B0JRzcqmOYvzbqyJ9lPd7e1JlbggMI","data":{"email":"admin@local","roles":["admins"],"_id":"b4PQNYC6Fe29a7VK"}}
User not found Socket unauthorized: {"name":"NotAuthenticated","message":"Invalid login.","code":401,"className":"not-authenticated","errors":{}}
You should not link to the master dist but to a specific version (which is what we are showing in the documentation). The current master requires feathers-authentication 1.0.0 on the server (and linking to it directly will break your app in the future).
As shown in the client documentation you can link to the latest backwards compatible 1.x version of this package using Unpkg like this:
Steps to reproduce
Client-side Gist: https://gist.github.com/robotlandman/4e7feb3ec15a964250ab2941dc8cc7bb
I'm using the unified feathers-client from here:
https://github.com/feathersjs/feathers-client/blob/master/dist/feathers.js
Expected behavior
client.authenticate() should redirect to the successful login page as specified in my login.js file or display an error if authentication is unsuccessful.
Actual behavior
The feathers-client socket timeout handler is hit in both cases - on successful authentication and user not found. The response is always: "Error: Authentication timed out" after the default 5 seconds.
I see the server reply on the socket right away (in the code I'm listening for 'authenticated' and 'unauthorized' socket events for testing) with the correct response, including the token when authentication is successful. The feathers-client ignores these responses and doesn't store the token in localStorage on successful authentication.
Here are the web browser console outputs for the socket events to confirm the authentication is happening as expected on feathers server-side:
Successful authentication
Socket authenticated: {"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJfaWQiOiJiNFBRTllDNkZlMjlhN1ZLIiwiaWF0IjoxNDkwMTAxOTIyLCJleHAiOjE0OTAxODgzMjIsImlzcyI6ImZlYXRoZXJzIn0.Uys3gyHUDV_78B0JRzcqmOYvzbqyJ9lPd7e1JlbggMI","data":{"email":"admin@local","roles":["admins"],"_id":"b4PQNYC6Fe29a7VK"}}
User not found
Socket unauthorized: {"name":"NotAuthenticated","message":"Invalid login.","code":401,"className":"not-authenticated","errors":{}}
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
Server-Side
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Client-Side
Whatever is bundled in the latest feathers-client/dist/feathers.js file - not sure how you tell the version?
NodeJS version:
v6.10.0
Operating System:
Server: Ubuntu 16.04
Client: Windows 10
Browser Version:
Chrome 56.0.2924.87
Firefox 52.0.1
React Native Version:
N/A
Module Loader:
N/A
The text was updated successfully, but these errors were encountered: