diff options
| author | Adam Soltys <[email protected]> | 2023-04-06 15:25:07 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-04-06 15:25:07 -0700 |
| commit | 99b72e143866d5cc62ba04847885070dc9a5c645 (patch) | |
| tree | abda08ae881b6e9bfff2ebbcf58d1409d7395fcf /lib/auth.js | |
| parent | 5083648dc113547c1c604e0c93ed0ee961f01ea3 (diff) | |
| download | coinos-server-99b72e143866d5cc62ba04847885070dc9a5c645.tar.gz coinos-server-99b72e143866d5cc62ba04847885070dc9a5c645.zip | |
prettier
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 d9d2a8e5..0533de31 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; |
