What does “.Strategy” do in Node or Passport?











up vote
0
down vote

favorite












What does ".Strategy" do here? Is it Node? Is it Passport?



var LocalStrategy = require('passport-local').Strategy;


Everything up to '.Strategy' part I understand. I just want to know what '.Strategy' does. I have checked the documentation on passport-local module on npm. I have also checked Passport's documentation, and it is just used in code snippets. No explanation is provided.



I am working with the MEAN stack and we are using Passport to authenticate users.










share|improve this question
























  • Did you look at npmjs.com/package/passport-local? Search for "passport strategy"? I seem to be finding a fair bit of documentation.
    – jonrsharpe
    Nov 10 at 18:08










  • Yeah, that's the first place I looked. It doesn't exactly tell me what ".Strategy" does though. Everything leading up to the ".Strategy" part I understand.
    – UhHuhOkSure
    Nov 10 at 18:13










  • What do you mean what it does? You can see the implementation, it's open source. Or look at the abstract version: github.com/jaredhanson/passport-strategy
    – jonrsharpe
    Nov 10 at 18:16










  • I didn't know to look in the local strategy source code because there wasn't anything in the documentation about it. As far as I could tell, it could have been a Node thing or a Passport thing.
    – UhHuhOkSure
    Nov 10 at 18:31










  • But you can see where it's coming from when you require it, what other information would you need to find it? You can see in the index file it comes from strategy.js, which seems logical.
    – jonrsharpe
    Nov 10 at 18:32

















up vote
0
down vote

favorite












What does ".Strategy" do here? Is it Node? Is it Passport?



var LocalStrategy = require('passport-local').Strategy;


Everything up to '.Strategy' part I understand. I just want to know what '.Strategy' does. I have checked the documentation on passport-local module on npm. I have also checked Passport's documentation, and it is just used in code snippets. No explanation is provided.



I am working with the MEAN stack and we are using Passport to authenticate users.










share|improve this question
























  • Did you look at npmjs.com/package/passport-local? Search for "passport strategy"? I seem to be finding a fair bit of documentation.
    – jonrsharpe
    Nov 10 at 18:08










  • Yeah, that's the first place I looked. It doesn't exactly tell me what ".Strategy" does though. Everything leading up to the ".Strategy" part I understand.
    – UhHuhOkSure
    Nov 10 at 18:13










  • What do you mean what it does? You can see the implementation, it's open source. Or look at the abstract version: github.com/jaredhanson/passport-strategy
    – jonrsharpe
    Nov 10 at 18:16










  • I didn't know to look in the local strategy source code because there wasn't anything in the documentation about it. As far as I could tell, it could have been a Node thing or a Passport thing.
    – UhHuhOkSure
    Nov 10 at 18:31










  • But you can see where it's coming from when you require it, what other information would you need to find it? You can see in the index file it comes from strategy.js, which seems logical.
    – jonrsharpe
    Nov 10 at 18:32















up vote
0
down vote

favorite









up vote
0
down vote

favorite











What does ".Strategy" do here? Is it Node? Is it Passport?



var LocalStrategy = require('passport-local').Strategy;


Everything up to '.Strategy' part I understand. I just want to know what '.Strategy' does. I have checked the documentation on passport-local module on npm. I have also checked Passport's documentation, and it is just used in code snippets. No explanation is provided.



I am working with the MEAN stack and we are using Passport to authenticate users.










share|improve this question















What does ".Strategy" do here? Is it Node? Is it Passport?



var LocalStrategy = require('passport-local').Strategy;


Everything up to '.Strategy' part I understand. I just want to know what '.Strategy' does. I have checked the documentation on passport-local module on npm. I have also checked Passport's documentation, and it is just used in code snippets. No explanation is provided.



I am working with the MEAN stack and we are using Passport to authenticate users.







node.js passport.js mean-stack






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 18:16

























asked Nov 10 at 18:06









UhHuhOkSure

1225




1225












  • Did you look at npmjs.com/package/passport-local? Search for "passport strategy"? I seem to be finding a fair bit of documentation.
    – jonrsharpe
    Nov 10 at 18:08










  • Yeah, that's the first place I looked. It doesn't exactly tell me what ".Strategy" does though. Everything leading up to the ".Strategy" part I understand.
    – UhHuhOkSure
    Nov 10 at 18:13










  • What do you mean what it does? You can see the implementation, it's open source. Or look at the abstract version: github.com/jaredhanson/passport-strategy
    – jonrsharpe
    Nov 10 at 18:16










  • I didn't know to look in the local strategy source code because there wasn't anything in the documentation about it. As far as I could tell, it could have been a Node thing or a Passport thing.
    – UhHuhOkSure
    Nov 10 at 18:31










  • But you can see where it's coming from when you require it, what other information would you need to find it? You can see in the index file it comes from strategy.js, which seems logical.
    – jonrsharpe
    Nov 10 at 18:32




















  • Did you look at npmjs.com/package/passport-local? Search for "passport strategy"? I seem to be finding a fair bit of documentation.
    – jonrsharpe
    Nov 10 at 18:08










  • Yeah, that's the first place I looked. It doesn't exactly tell me what ".Strategy" does though. Everything leading up to the ".Strategy" part I understand.
    – UhHuhOkSure
    Nov 10 at 18:13










  • What do you mean what it does? You can see the implementation, it's open source. Or look at the abstract version: github.com/jaredhanson/passport-strategy
    – jonrsharpe
    Nov 10 at 18:16










  • I didn't know to look in the local strategy source code because there wasn't anything in the documentation about it. As far as I could tell, it could have been a Node thing or a Passport thing.
    – UhHuhOkSure
    Nov 10 at 18:31










  • But you can see where it's coming from when you require it, what other information would you need to find it? You can see in the index file it comes from strategy.js, which seems logical.
    – jonrsharpe
    Nov 10 at 18:32


















Did you look at npmjs.com/package/passport-local? Search for "passport strategy"? I seem to be finding a fair bit of documentation.
– jonrsharpe
Nov 10 at 18:08




Did you look at npmjs.com/package/passport-local? Search for "passport strategy"? I seem to be finding a fair bit of documentation.
– jonrsharpe
Nov 10 at 18:08












Yeah, that's the first place I looked. It doesn't exactly tell me what ".Strategy" does though. Everything leading up to the ".Strategy" part I understand.
– UhHuhOkSure
Nov 10 at 18:13




Yeah, that's the first place I looked. It doesn't exactly tell me what ".Strategy" does though. Everything leading up to the ".Strategy" part I understand.
– UhHuhOkSure
Nov 10 at 18:13












What do you mean what it does? You can see the implementation, it's open source. Or look at the abstract version: github.com/jaredhanson/passport-strategy
– jonrsharpe
Nov 10 at 18:16




What do you mean what it does? You can see the implementation, it's open source. Or look at the abstract version: github.com/jaredhanson/passport-strategy
– jonrsharpe
Nov 10 at 18:16












I didn't know to look in the local strategy source code because there wasn't anything in the documentation about it. As far as I could tell, it could have been a Node thing or a Passport thing.
– UhHuhOkSure
Nov 10 at 18:31




I didn't know to look in the local strategy source code because there wasn't anything in the documentation about it. As far as I could tell, it could have been a Node thing or a Passport thing.
– UhHuhOkSure
Nov 10 at 18:31












But you can see where it's coming from when you require it, what other information would you need to find it? You can see in the index file it comes from strategy.js, which seems logical.
– jonrsharpe
Nov 10 at 18:32






But you can see where it's coming from when you require it, what other information would you need to find it? You can see in the index file it comes from strategy.js, which seems logical.
– jonrsharpe
Nov 10 at 18:32



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241922%2fwhat-does-strategy-do-in-node-or-passport%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241922%2fwhat-does-strategy-do-in-node-or-passport%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

さくらももこ

13 indicted, 8 arrested in Calif. drug cartel investigation