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

user field not getting populated #119

Closed
PhilWhitehurst opened this issue Mar 24, 2016 · 2 comments
Closed

user field not getting populated #119

PhilWhitehurst opened this issue Mar 24, 2016 · 2 comments
Milestone

Comments

@PhilWhitehurst
Copy link

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?

@ekryski
Copy link
Member

ekryski commented Mar 24, 2016

This has been fixed in #109. which is landing soon! 😄

@ekryski
Copy link
Member

ekryski commented Mar 24, 2016

Closed in v0.6.0 by #109.

@ekryski ekryski closed this as completed Mar 24, 2016
@ekryski ekryski modified the milestone: 0.6 Mar 26, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants