Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/controller/user-management-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ class UserManagementController implements IController {
let user_name = request.query.user_name;
if (user_name == undefined || user_name == null) throw new HttpException(400, "user_name query param missing");

const rawQuery = request.originalUrl.split("?")[1] || "";
const match = rawQuery.match(/user_name=([^&]*)/);
user_name = match ? match[1] : "";
user_name = decodeURIComponent(user_name);
return userManagementServiceInstance.getUserProfile(user_name as string).then((result) => {
Ok(response, result);
}).catch((error: any) => {
Expand Down
5 changes: 5 additions & 0 deletions src/middleware/authorization-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ function authorizationMiddleware(roles: string[], validateProjectGroup?: boolean

let authToken = Utility.extractToken(req);

if (roles.length > 0 && authToken == null) {
next(new Forbidden());
return;
}

if (authToken == null) {

if (allowInraCom) {
Expand Down
Loading