Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/event-system/services/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,16 @@ module.exports = {
try {

const secretKey = ctx?.meta?.request?.headers?.['x-mock-user-secret-key'];

if (!secretKey) {
throw new MoleculerError(
'The secret key is missing',
401,
'unauthorized',
{}
);
}

if (secretKey !== process.env.MOCK_USER_SECRET_KEY) {
throw new MoleculerError(
'The secret key is invalid',
Expand Down Expand Up @@ -836,7 +846,7 @@ module.exports = {
}
catch (error) {
console.error(error);
throw new AuthGenericError();
throw error;
}
}

Expand Down
Loading