diff options
| author | Adam Soltys <[email protected]> | 2023-03-11 10:20:46 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-11 10:20:46 -0800 |
| commit | 5955ff6969a5301c4413631b76cf2300d193f8ed (patch) | |
| tree | 92d1269a098cb7c764ca92f7a40af9ee236ae5b1 /lib/auth.js | |
| parent | 7fec7cc3e7c51a9892869732b5bfe65922ee7818 (diff) | |
| download | coinos-server-5955ff6969a5301c4413631b76cf2300d193f8ed.tar.gz coinos-server-5955ff6969a5301c4413631b76cf2300d193f8ed.zip | |
separate tips from amounts
Diffstat (limited to 'lib/auth.js')
| -rw-r--r-- | lib/auth.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/auth.js b/lib/auth.js index 0533de31..d9d2a8e5 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -7,17 +7,17 @@ export const optional = { preValidation: fastifyPassport.authenticate( "jwt", { session: false }, - function(req, res, err, user, info) { + function (req, res, err, user, info) { req.user = user; } - ) + ), }; export const auth = { preValidation: fastifyPassport.authenticate("jwt", { authInfo: false, - session: false - }) + session: false, + }), }; export const requirePin = async ({ body, user }) => { @@ -29,9 +29,9 @@ export const jwtStrategy = new jwt.Strategy( { jwtFromRequest: jwt.ExtractJwt.fromExtractors([ jwt.ExtractJwt.fromAuthHeaderAsBearerToken(), - req => (req.cookies ? req.cookies.token : null) + (req) => (req.cookies ? req.cookies.token : null), ]), - secretOrKey: config.jwt + secretOrKey: config.jwt, }, async (payload, next) => { let user; |
