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

`hook.params.provider` is not set when calling `client.authenticate()` #432

Closed
huafu opened this Issue Mar 5, 2017 · 10 comments

Comments

Projects
None yet
5 participants
@huafu
Copy link

huafu commented Mar 5, 2017

When calling client.authenticate() in the client (here I'm using socket.io), the authenticate.create service method is called on the server, but hook.params.provider is undefined while I think it should be set, even tho the client.authenticate() is triggering this service call thru a custom socket event. Same for client.logout().

I am using 1.0.2 version of feathers-authentication.

@huafu huafu changed the title `hook.provider` is not set when calling `app.authenticate()` in the client `hook.provider` is not set when calling `client.authenticate()` Mar 5, 2017

@huafu huafu changed the title `hook.provider` is not set when calling `client.authenticate()` `hook.params.provider` is not set when calling `client.authenticate()` Mar 5, 2017

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Mar 6, 2017

Agreed. Thanks for the issue. I'll try and tackle that one quickly.

@huafu

This comment has been minimized.

Copy link
Author

huafu commented Mar 18, 2017

any news on that? should I try to do it myself or any chance you'll get a look at it any time soon? I really need it and it's kinda blocking, but I'd rather have someone knowing the framework better than me doing it the right way :D

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Mar 23, 2017

Fixed in #459

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Mar 23, 2017

Going to close this we'll release shortly.

@IamCarbonMan

This comment has been minimized.

Copy link

IamCarbonMan commented Oct 14, 2017

Any update on this? It's been several months and this is preventing me from being able to do

commonHooks.when(hook => hooks.params.provider, commonHooks.discard("password"))

which is pretty necessary for proper security.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Oct 14, 2017

@IamCarbonMan

This comment has been minimized.

Copy link

IamCarbonMan commented Oct 14, 2017

I'm using 1.2.7 and still having the same issue.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Oct 14, 2017

@marshallswain Any thoughts?

@IamCarbonMan

This comment has been minimized.

Copy link

IamCarbonMan commented Oct 14, 2017

My setup is definitely not the standard feathers-cli generated app, so it might be something else. The server is a single file, here it is in a gist. The actual error I get in the browser when calling client.authenticate is "cannot read property provider of undefined", suggesting that hook.params is itself undefined for some reason.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Oct 14, 2017

You have a typo in https://gist.github.com/IamCarbonMan/f1374ecb0fb6d1adb8fd57158d55fad5#file-server-js-L16. It should be hook.params.provider not hooks.params.provider (hence the error you were getting).

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.