balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.84k stars 1.95k forks source link

sails 1.0 sails.controllers #4672

Open Hodor9898 opened 6 years ago

Hodor9898 commented 6 years ago

Hi,

A lot of hooks used to add controllers using sails.controllers, since sails 1.0 that functionality is broken... and a lot of useful dependencies do not work any more, I really am very disappointed in the sails team, so many useful dependencies stop working after each update, it is hard to work with this framework this way...

I tried using the sails-auth-new dependency and it doesn't work with sails 1.0 because it attempts to register its controllers which causes:

warn: Ignored attempt to bind route (/logout) to unknown action { controller: 'AuthController', skipAssets: true, action: 'logout' }

I am going to fork this dependency and try and fix it, how can i register a controller?

rachaelshaw commented 6 years ago

Hi @Hodor9898,

A lot changed with the release of Sails 1.0, but that's not super unusual for a major version release -- and I firmly believe that most of the changes in 1.0 were for the better.

The thing about 3rd party packages is that they're not a core part of Sails, and because we don't maintain them ourselves, we have no control over their quality or compatibility with new versions of the framework. If your app depends on a lot of installable hooks that were developed specifically for Sails v0.12 and aren't compatible with 1.0, then it might make sense to hold off on upgrading your project until you've found other solutions.

To answer your question about how to register actions programmatically in a custom hook: check out the docs on sails.registerAction().

That said, it looks like you're trying to implement authentication for your app -- rather than relying on a 3rd party package for that, I highly recommend generating new apps with the "Web App" template if you're able to, which has login built in.

Hope this helps!

sailsbot commented 5 years ago

Hi @Hodor9898! It looks like you may have removed some required elements from the initial comment template, without which I can't verify that this post meets our contribution guidelines. To re-open this issue, please copy the template from here, paste it at the beginning of your initial comment, and follow the instructions in the text. Then post a new comment (e.g. "ok, fixed!") so that I know to go back and check.

Sorry to be a hassle, but following these instructions ensures that we can help you in the best way possible and keep the Sails project running smoothly.

*If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact inquiries@sailsjs.com

raqem commented 5 years ago

Hi @Hodor9898, We are in the processes of moving all open Sails issues into one repository to help the devs keep a better eye on goings ons. ~Cheers