feat: Implement users/me API endpoint

This commit is contained in:
Faruk AYDIN
2024-02-13 02:04:50 +01:00
parent 95f89ba03e
commit 9f0e0ca656
7 changed files with 93 additions and 0 deletions

View File

@@ -28,6 +28,14 @@ export const isAuthenticated = async (_parent, _args, req) => {
}
};
export const authenticateUser = async (request, response, next) => {
if (await isAuthenticated(null, null, request)) {
next();
} else {
return response.status(401).end();
}
};
const isAuthenticatedRule = rule()(isAuthenticated);
export const authenticationRules = {