Skip to content
Advertisement

Tag: passport.js

Node + Passport, Error: Authentication strategies must have a name

I’m trying to initialize a SAML strategy during the require line. Something like this: but am getting the error: or TypeError: Cannot read property ‘name’ of undefined at Authenticator.use if a custom strategy name is not defined: passport.use(myStrat); . I’ve had it like this (which works): but I wish to change it because I need to call passport-saml’s Stragety.generateServiceProviderMetadata() function

how to delete cookie on logout in express + passport js?

I want to “delete cookies on logout”. I am not able to do that. I googled for answer and found following ways: Assign new date of expiration to cookie res.cookie(‘connect.sid’, ”, {expires: new Date(1), path: ‘/’ }); Delete cookie using below lines res.clearCookie(‘connect.sid’, { path: ‘/’ }); I tried both ways individually but they do not delete the cookie. Here

Advertisement