From de42eda65f559b68bfa10c693e7eb4a0e559f1e5 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Mon, 30 Sep 2024 12:04:37 +0000 Subject: [PATCH] refactor(helpers/authentication): remove obsolete arguments in isAuthenticated --- packages/backend/src/helpers/authentication.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/helpers/authentication.js b/packages/backend/src/helpers/authentication.js index ac7c3426..cfbb20d4 100644 --- a/packages/backend/src/helpers/authentication.js +++ b/packages/backend/src/helpers/authentication.js @@ -1,7 +1,7 @@ import User from '../models/user.js'; import AccessToken from '../models/access-token.js'; -export const isAuthenticated = async (_parent, _args, req) => { +export const isAuthenticated = async (req) => { const token = req.headers['authorization']; if (token == null) return false; @@ -40,7 +40,7 @@ export const isAuthenticated = async (_parent, _args, req) => { }; export const authenticateUser = async (request, response, next) => { - if (await isAuthenticated(null, null, request)) { + if (await isAuthenticated(request)) { next(); } else { return response.status(401).end();