enabled context and fix some api

This commit is contained in:
2024-10-28 20:21:36 +07:00
parent f0e90ba234
commit 5c1d4e92af
10 changed files with 266 additions and 42 deletions

View File

@@ -14,8 +14,8 @@ export class GraphqlService {
const disableAuth = process.env.DISABLE_AUTH === 'true';
try {
sessionId = req.headers['x-session-id'] as string;
//eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) {
Logger.error('Error acquiring context', error);
if (disableAuth) {
return null;
}
@@ -35,6 +35,7 @@ export class GraphqlService {
if (!user) {
throw new UnauthorizedException('User not found');
}
Logger.log(`User ${user.name} with id ${user.id} acquired context`);
return user;
}
}