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

Feathers-authentication assumptions #220

Closed
dfischer opened this Issue Jun 3, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@dfischer
Copy link

dfischer commented Jun 3, 2016

I am trying to leverage the add to slack button from Slack's API which is an oauth negotiation to get back some tokens.

This means I don't want to create a user. Right now leveraging the flow through feathers-authentication causes a user to be created. Additionally, I need to grab other things from the payload from Slack but I'm not understanding how to do that. It's in the response but need to do further things with creating another service (i.e Integration). Is there a way to do a callback of some sort?

Is it in feathers-authentication's vision to support bypassing creating a user, or should I drop down to express and leverage vanilla passport?

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Jun 3, 2016

@dfischer if you need stuff from the Slack response payload, why not turn the users service into a memory store? Let feathers-authentication save the payload to memory, grab the data you want, then clear the user record from the memory store, so it won't be sitting around.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Jun 3, 2016

Another option would be to skip the user creation in a before hook if it has the Slack payload:

app.service('users').before({
  create(hook) {
    if(hook.data.slack) {
      hook.result = hook.data;
    }
  }
});
@dfischer

This comment has been minimized.

Copy link
Author

dfischer commented Jun 3, 2016

@daffl how would I then grab that hook data into, let's say, an integration service that the goal is to save the slack data into that object (Integration object). In the same if condition I'm guessing?

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Jun 8, 2016

Both are pretty solid options there. I'll throw another in the ring. You could have your own custom user service that does whatever custom stuff you wanna do inside of it. It's kind of bastardizing the concept but might do the trick for you.

@ekryski ekryski added the Question label Jun 8, 2016

@dfischer

This comment has been minimized.

Copy link
Author

dfischer commented Jun 8, 2016

Thanks guys!

@dfischer dfischer closed this Jun 8, 2016

@daffl daffl removed the Question label Jun 8, 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.