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

userEndpoint problem in sub-app #63

Closed
wuyuanyi135 opened this Issue Feb 15, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@wuyuanyi135
Copy link

wuyuanyi135 commented Feb 15, 2016

For example, I have a user service handling user login

/api/user/auth/local

In another service, which is mounted as sub-app, I want to verify the user, the path is

/api/riddle

The problem is, how can I set the userEndpoint of the hook in /api/riddle like this

        authHooks.populateUser({userEndpoint: '../user'}),

@wuyuanyi135 wuyuanyi135 changed the title localEndpoint problem in sub-app userEndpoint problem in sub-app Feb 15, 2016

@wuyuanyi135

This comment has been minimized.

Copy link
Author

wuyuanyi135 commented Feb 15, 2016

Probably in my case I should use middleware and jwt to protect the sub-apps.
For example I can mount a middleware using jwt at /private-api and mount the apps requiring authentication as its sub apps.

That's why I opened an issue at feathers-hooks. I wonder if its possible to mount these provided hooks as middlewares to authenticate non-service app

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Feb 16, 2016

@wuyuanyi135 Ya again, you could do what you are hoping to do when this issue is closed feathersjs/feathers#216.

Currently you can pass a custom userEndpoint to the populateUser hook but that won't work for sub apps.

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.