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

Adding user object into the request #68

Open
eddieajau opened this issue May 8, 2015 · 3 comments
Open

Adding user object into the request #68

eddieajau opened this issue May 8, 2015 · 3 comments

Comments

@eddieajau
Copy link

I'm just wondering if there is a convenient location to add the user object into the request.

For example, the in isAdmin policy (see https://github.com/tarlepp/angular-sailsjs-boilerplate/blob/master/backend/api/policies/isAdmin.js#L16) you are finding the user. I will likely want a number of policies to access the user object, so is there a good place to set req.user?

Thanks in advance.

@tarlepp
Copy link
Owner

tarlepp commented May 8, 2015

At this point "boilerplate" don't have really usage for this, but basically you have current user ID in request.token which is set on the authenticated policy (https://github.com/tarlepp/angular-sailsjs-boilerplate/blob/master/backend/api/policies/authenticated.js#L31) after user has been authenticated.

So basically that's the point that you're looking for. I hope this helps.

@tarlepp
Copy link
Owner

tarlepp commented Jun 6, 2015

So did this help on your problem?

@tarlepp
Copy link
Owner

tarlepp commented Mar 5, 2016

I'm still waiting for the answer for "So did this help on your problem?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants