3

Does someone know how to use JWT in sails.js with passport?

I saw this link to do it node.js : passport-local with node-jwt-simple

But routes and controllers with sails-generate-auth seems differents so I don't know how to integrate it

Community
  • 1
  • 1
moubert
  • 262
  • 5
  • 16
  • I went through this nice tutorial here: https://ericswann.wordpress.com/2015/04/24/nozus-js-1-intro-to-sails-with-passport-and-jwt-json-web-token-auth/ – Zhang Sep 12 '15 at 14:33

2 Answers2

4

Take a look at waterlock.ninja it's made for sailsJS and does all the JWT stuff OOTB :)

  • I already saw waterlock...In node.js I used passport but I'm new in sails... The fact is that I would continue to use passport with sails( I took the package sails-generate-auth). – moubert May 05 '15 at 14:30
  • it is simple to swap over to waterlock and it will make your life a ton easier! –  May 05 '15 at 14:44
  • @AmanGautam To be fair that is not true - as I commented here: https://github.com/waterlock/waterlock/issues/118#issuecomment-208983502 I am working on v2 here https://github.com/wayne-o/waterlock here https://github.com/wayne-o/waterlock-google-auth here https://github.com/wayne-o/waterlock-facebook-auth here https://github.com/wayne-o/waterlock-local-auth and a new Spotify auth here https://github.com/wayne-o/waterlock-spotify-auth - This is OS software - meaning you can chime in at any point. –  Apr 29 '16 at 08:14
  • Hey - i have commit access to the main repos .I'm just getting my stuff stable enough before i start pushing it back up - there are a few breaking changes and I've taken the liberty to make some decisions that will need to be discussed with the other team members and users of the project -what suits me might not suit everybody :) –  May 02 '16 at 09:45
1

I found a repo on github doing exactly what I was looking for(passport + jsonwebtokens with sails on the back) with in bonus a frontend written in angular

https://github.com/ProLoser/angular-sails-seed

moubert
  • 262
  • 5
  • 16