Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Example of usage? #2

Open
khayamy001 opened this issue Jun 24, 2018 · 2 comments
Open

Example of usage? #2

khayamy001 opened this issue Jun 24, 2018 · 2 comments

Comments

@khayamy001
Copy link

Hey,

I've been spending a couple of days now trying to figure out how to set up authentication with sails in a proper way. After lots of tinkering and problems, I ran into your fork. Now I'm not an expert on sails so maybe there is an obvious answer, but it is not clear to me how we can use this package.

I installed the hook and tried calling the endpoint, but it seems like there is no routing / reference to the endpoints. I also cloned this repo and tried running it but ran into some errors which I expected.

I saw the other issue (#1) but it is already over a year old, is it still necessary to reference every single file with an import?

Thanks in advance, I hope to get a conversation started, I'm really invested into fixing this issue.

@MrMaz
Copy link

MrMaz commented Jun 25, 2018

Hi Youssef!

Yes, the import is still required. The company I work for that supports the development of this hook still uses the explicit imports in all of our projects. For us it still a bit painful, but we customize the models and controllers quite a bit, so in the end is not too bad.

If you have some time to make a contribution, I can provide a template of the new hook loader pattern we use for newer modules, and you might be able to take a shot at the refactoring.

Can you briefly describe the challenges of your project? I can review and see if this hook is a good fit for you.

Regards,
Marshall

@khayamy001
Copy link
Author

Hi MrMaz,

Thanks for the quick reply!

I'll be happy to at least give it a try, but I'm not 100% sure what you mean by refactoring.
What I'm really looking for is a push in the right direction on how to set up a simple sails project using this hook. If this means I have to help modify it I'm up for it, I've looked into the source code a fair amount by now considering it's not a lot to begin with fortunately.

The project I'm working on is just a simple REST api, but I need to have the ability to support a fair amount of login providers simultaneously. I basically need the 3rd party access tokens to make API calls to these respective platforms (twitch, youtube, facebook). My idea was to use PassportJS in combination with Sails because I come from a background in Rails and liked the simplicity of the framework. Naturally I ended up running into the sails-auth package which looked promising but very outdated, but solved the exact problem I'm having, which is dealing with a large amount of external providers in a clean way. Hence running into your fork I was happy to see someone was continuing work on the Hook.

I'm still in the setup phase of the project, so I'm open for 'radical' changes, but if you have any other ideas or suggestions I'm also happy to hear them! In the end all I want is the most straightforward solution that isn't outdated by the time npm install has finished running.

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

No branches or pull requests

2 participants