Open MindRave opened 9 years ago
I have got the same issue and have yet to get sails-auth
to work. Using sails-auth
2.1.1 and sails
0.12.0-rc3.
Any help would be appreciated.
+1 (I know "plus ones" aren't great but I agree with @anissen - It'd be great to get some help. Thank you!)
+1
I'm having the same problem. +1
Same here +1
Hey everyone!
On my end, I managed to find a "solution" (so to speak, because it's more of a workaround than a real solution) by removing sails-auth entirely (npm uninstall sails-auth) and by using passport directly.
The solution resembles what you can find in this write up on "I Like Tomatoes": http://iliketomatoes.com/implement-passport-js-authentication-with-sails-js-0-10-2/
On my end, it works as it should using a local strategy (and it works on heroku).
Hope this issue gets fixed in the future.
I'm also getting this error on a fresh install.
How to reproduce:
sails new webapp cd webapp npm install sails-auth --save sails lift
I'm doing this is the latest versions.
+1 sails-auth@2.1.1 sails@0.12.0-rc3
It is said in the sails docs how to call services http://sailsjs.org/documentation/concepts/services/creating-a-service
You should be able to call the Passport service directly.
Hello everybody!
Here's an error I've just spent two hours on (error thrown when posting on the login route): "TypeError: Cannot read property 'initialize' of undefined at module.exports (/Users/JohnDoe/Developer/project_name/node_modules/sails-auth/dist/api/policies/passport.js:35:11)"
That line is the following:
var passport = sails.services.passport;
Due to the issue, the server was throwing a 500 error every time I was trying to log in using a local strategy.
Replacing "var passport = sails.services.passport" with the usual "var passport = require('passport')" works just fine.
Now, I believe this means I won't be able to deploy my app on Heroku, seeing as the package.json components are built on heroku's servers, upon deployment, and I'm not able to just go in node_modules as I did here, and replace a line.
This also means, if that is the case, that I need to drop sails, as quickly as possible, to keep making progress on my project.
Any ideas on how to fix this outside of going inside "node_modules"? Do you need to see any of my other code (but seeing as replacing the line "just works", this shouldn't be an issue with my code, or should it?).
Using sails-auth version "2.1.1".
Thank you in advance!