Skip to content

Commit

Permalink
Authorization middleware logic fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
djordjekovac committed Sep 22, 2023
1 parent ab85e74 commit 5e93746
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const getToken = (req) => {
};

export default (authService) => async (req, res, next) => {
const operation = req.url.split('/')[1].split('?')[0].toUpperCase();
const urlElements = req.url.split('/');
const operation = urlElements[urlElements.length() - 1].split('?')[0].toUpperCase();

if (authService.isPublicOperation(operation)) {
return next();
Expand Down

0 comments on commit 5e93746

Please sign in to comment.