Skip to content

Commit 06b4036

Browse files
committed
fix: adjust call on authentication middleware
1 parent 7170f3c commit 06b4036

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/meteor/app/api/server/middlewares/authentication.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export function authenticationMiddleware(
2727
if (userId && authToken) {
2828
req.user = (await Users.findOneByIdAndLoginToken(userId as string, hashLoginToken(authToken as string))) || undefined;
2929
} else {
30-
req.user = (await oAuth2ServerAuth(req))?.user;
30+
req.user = await oAuth2ServerAuth({
31+
headers: req.headers as Record<string, string | undefined>,
32+
query: req.query as Record<string, string | undefined>,
33+
});
3134
}
3235

3336
if (config.rejectUnauthorized && !req.user) {

apps/meteor/app/oauth2-server-config/server/oauth/oauth2-server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,3 @@ API.v1.addAuthMethod((request: globalThis.Request) => {
8383
});
8484

8585
(WebApp.connectHandlers as unknown as ReturnType<typeof express>).use(oauth2server.app);
86-

0 commit comments

Comments
 (0)