trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
265 stars 141 forks source link

How to use sails-auth in sails project? #124

Open gokul-t opened 8 years ago

gokul-t commented 8 years ago

how can i use sails-auth hook in my sails project.I installed sails-auth using npm install sails-auth --save.and when running project terminal logs says sails-auth controllers,services,models are loaded using marlinspike. But i don't have any idea about further steps.please help me..

nickvoegeli commented 8 years ago

+1

The routes suggested in the readme are returning 404's for me after following the instructions.

josmardias commented 8 years ago

After installing this package I was expecting a GET to /auth/facebook on my app to "simply" exist and return a 302 redirect, due to

//https://github.com/tjwebb/sails-auth/blob/master/config/routes.js
'get /auth/:provider': 'AuthController.provider',

But I only get a 404 Not Found...

I'm getting marlinspike/sails-auth debug messages btw:

debug: marlinspike (auth): loading Services from (...)/node_modules/sails-auth/dist/api/services...
debug: marlinspike (auth): loading Models...
debug: marlinspike (auth): loading Controllers...
debug: marlinspike (auth): loading Policies...
nickvoegeli commented 8 years ago

I just did a writeup on installing the sails-permissions package that includes detailed instructions for sails-auth. Here's a link.

josmardias commented 8 years ago

In my case, the problem was sails version. Seems like it's working only with Sails >= 0.12

emudojo commented 8 years ago

Using sails 12 and the latest sails-auth works, without having to do any configuration by hand

smyth64 commented 7 years ago

Just use the files from sails-permission code! I had problems using sails-auth only, but now everything works like charm :)

https://github.com/langateam/sails-permissions