Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user field not getting populated #119

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

Comments

Projects
None yet
2 participants
@PhilWhitehurst
Copy link

PhilWhitehurst commented Mar 24, 2016

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

This comment has been minimized.

Copy link
Member

ekryski commented Mar 24, 2016

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

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Mar 24, 2016

Closed in v0.6.0 by #109.

@ekryski ekryski closed this Mar 24, 2016

@ekryski ekryski modified the milestone: 0.6 Mar 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.