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 was archived by the owner on Mar 22, 2022. It is now read-only.
When I send a successfull local authentication with email and password it is able to authenticate the user and sends a JWT back to the client. I'm using local storage option to store the JWT. This is all done over socketio, I don't use rest at all.
I can see in my before hooks for a find in my service that the token is present at hooks.params.token, so far so good. I need to get the user details in my hook and pass some parts down to the query. I can't for the life of me get it to populate the user field to populate the userid into the query.
I'm using this to authenticate users to my app.
I use it with default options
// Register our authentication plugin
app.configure(authentication());
When I send a successfull local authentication with email and password it is able to authenticate the user and sends a JWT back to the client. I'm using local storage option to store the JWT. This is all done over socketio, I don't use rest at all.
I can see in my before hooks for a find in my service that the token is present at hooks.params.token, so far so good. I need to get the user details in my hook and pass some parts down to the query. I can't for the life of me get it to populate the user field to populate the userid into the query.
app.service('track').before({
find: [authentication.hooks.populateUser(),
authentication.hooks.queryWithUserId(),
function (hooks) {
console.log(hooks.params.token);
return hooks;
}]
});
What am I missing / what do I need to do to get the userid / details of an authenticated user over the socketio connection?
The text was updated successfully, but these errors were encountered: