Skip to content

yarax/passport-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passport-url

Url strategy for Passport.js. Allow to authenticate user by some hash string giving by GET query.

Install

npm install passport-url

Usage

Configure Strategy

var url = new UrlStrategy({
    failRedirect : "/login",
    varName : "secret"
}, function (secret, done) { // put your check logic here
    if (secret == 'foo') done(null, {id:'bar'});
    else done("wrong");
});

passport.use(url);

varName is a argument in your query e.g http://example.com/?secret=foo

failRedirect url for redirecting, when your verify function return callback with error

For full example please see https://github.com/yarax/passport-url/blob/master/example.js

Tests

npm test

About

Url based auth strategy for passport

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published