diff options
| author | Adam Soltys <[email protected]> | 2020-07-22 23:40:51 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-07-22 23:40:51 -0700 |
| commit | a38b44306546af56f666add49842fedc25cb35e1 (patch) | |
| tree | 673788cde7de32bf22f6967a5979d6a1f35c649c /lib | |
| parent | 4521dfbb74b2133ae06798ad4702971bb3fddd2f (diff) | |
| download | coinos-server-a38b44306546af56f666add49842fedc25cb35e1.tar.gz coinos-server-a38b44306546af56f666add49842fedc25cb35e1.zip | |
conduct internal swap
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/passport.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/passport.js b/lib/passport.js index 1d80d9b8..8f87d42d 100644 --- a/lib/passport.js +++ b/lib/passport.js @@ -28,4 +28,12 @@ passport = Passport.use( ); auth = passport.authenticate("jwt", { session: false }); + +optionalAuth = function (req, res, next) { + passport.authenticate("jwt", { session: false }, function (err, user, info) { + req.user = user; + next(); + })(req, res, next); +}; + app.use(passport.initialize()); |
