Skip to content Skip to sidebar Skip to footer

Using Passport-steam With Sails-generate-auth

I'm creating a SailsJS application, and I want users to log in only with Steam authentication. I used sails-generate-auth to create some boilerplate code with sails routes, but I'm

Solution 1:

This is caused by out-of-date source code in npm. Even with the latest 0.1.4 version, the code is not correct. Replacing strategy.js in passport-steam with the latest version will fix this error.

Also, in api\services\passport.js, a little custom handling in passport.connect() needs to be added. The profile does not have a username, but has an id (user steamid) and displayName. These can be used to set the user model properties, e.g.

//steam auth
if (profile.hasOwnProperty('displayName')) { 
  user.username = profile.displayName; 
}

Here is the ticket where the problem was solved: https://github.com/liamcurry/passport-steam/issues/10


Post a Comment for "Using Passport-steam With Sails-generate-auth"