aboutsummaryrefslogtreecommitdiffstats
path: root/lib/auth.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-10 23:36:34 -0800
committerAdam Soltys <[email protected]>2023-02-11 00:37:46 -0800
commit60cf57d56f617998e093e81b229e18c9a221e312 (patch)
treea7d0dbc1096b00cdc940ce1138e527fdbf92c2c2 /lib/auth.js
parenta059697ad1dab4308f9bc9c2957dc574f6e5518a (diff)
downloadcoinos-server-60cf57d56f617998e093e81b229e18c9a221e312.tar.gz
coinos-server-60cf57d56f617998e093e81b229e18c9a221e312.zip
prettier
Diffstat (limited to 'lib/auth.js')
-rw-r--r--lib/auth.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/auth.js b/lib/auth.js
index f3cfd1e9..2e26f138 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 = await g(`user:${payload.id}`);