enabled context and fix some api
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user