aboutsummaryrefslogtreecommitdiffstats
path: root/lib/auth.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-19 14:37:18 -0800
committerAdam Soltys <[email protected]>2023-12-20 14:39:08 -0800
commitb67ca07bac3a0cb78f9b3c19a783c3253f06c29f (patch)
tree1664d33bd1c514d016a7a1983af257197d4e5ac7 /lib/auth.js
parent337ca8c555f188d64c9f065972d443377adf042f (diff)
downloadcoinos-server-b67ca07bac3a0cb78f9b3c19a783c3253f06c29f.tar.gz
coinos-server-b67ca07bac3a0cb78f9b3c19a783c3253f06c29f.zip
biome
Diffstat (limited to 'lib/auth.js')
-rw-r--r--lib/auth.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/auth.js b/lib/auth.js
index 0e96218a..575d826e 100644
--- a/lib/auth.js
+++ b/lib/auth.js
@@ -9,15 +9,15 @@ export const optional = {
{ session: false },
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;
@@ -41,5 +41,5 @@ export const jwtStrategy = new jwt.Strategy(
}
next(null, user);
- }
+ },
);