You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the sails framework to authenticate a user with my custom facebook token strategy. It works perfectly. I copied this snippet of code from github to make it work, However, I don't quite understand the syntax of that last part which has (req, res); at the end. Obviously it's referring to request and response, but why is that line of code there, it seems to be in an awkward place. Authentication fails if I exclude that line of code. It must be important so I just need to figure out what it is doing .
@jadslim313 passport.authenticate() returns a function, which accepts req and res arguments. When you are using it in Express middlewares, it calls automatically. But, in Sails, you need to call it by yourself.
That makes sense ! I ended up removing res only having (req) in there. It worked just as fine, which makes sense as the token is in the request. However, what would the purpose of res be in this case? Just to make sure I'm not missing anything.
I used the sails framework to authenticate a user with my custom facebook token strategy. It works perfectly. I copied this snippet of code from github to make it work, However, I don't quite understand the syntax of that last part which has (req, res); at the end. Obviously it's referring to request and response, but why is that line of code there, it seems to be in an awkward place. Authentication fails if I exclude that line of code. It must be important so I just need to figure out what it is doing .
The text was updated successfully, but these errors were encountered: