aboutsummaryrefslogtreecommitdiffstats
path: root/lib/auth.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-31 09:29:04 -0700
committerAdam Soltys <[email protected]>2024-10-31 09:34:42 -0700
commitaa4cd39c943b67169def224e224bd07b815b70ec (patch)
tree2af857ac971705f4d20eb017864f0365d0b57ea6 /lib/auth.ts
parentbc9c04f6519f32d3b444d4df0b276eba960480a9 (diff)
downloadcoinos-server-aa4cd39c943b67169def224e224bd07b815b70ec.tar.gz
coinos-server-aa4cd39c943b67169def224e224bd07b815b70ec.zip
biome lint
Diffstat (limited to 'lib/auth.ts')
-rw-r--r--lib/auth.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/auth.ts b/lib/auth.ts
index 0a8d43d3..29edcf61 100644
--- a/lib/auth.ts
+++ b/lib/auth.ts
@@ -8,7 +8,7 @@ export const admin = {
preValidation: fastifyPassport.authenticate(
"jwt",
{ session: false },
- function (req, res, err, user, info) {
+ (req, res, err, user, info) => {
if (!user.admin) return res.code(401).send("unauthorized");
req.user = user;
},
@@ -19,7 +19,7 @@ export const optional = {
preValidation: fastifyPassport.authenticate(
"jwt",
{ session: false },
- function (req, res, err, user, info) {
+ (req, res, err, user, info) => {
req.user = user;
},
),
@@ -45,7 +45,7 @@ export const jwtStrategy = new jwt.Strategy(
secretOrKey: config.jwt,
},
async (payload, next) => {
- let user = await getUser(payload.id);
+ const user = await getUser(payload.id);
next(null, user);
},
);