refactor(helpers/authentication): remove obsolete arguments in isAuthenticated
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user