Skip to content

Commit

Permalink
Merge pull request #222 from TAMULib/2022_dec-221-return_to_safety
Browse files Browse the repository at this point in the history
Issue 221: Return to Safety, results in going back to 403.
  • Loading branch information
kaladay authored Dec 8, 2022
2 parents 355d882 + 034d9b7 commit b9cf28b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion app/controllers/errorPageController.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
core.controller("ErrorPageController", function ($scope, AccessControlService) {

$scope.lastRoute = AccessControlService.getLastRoutePath();
$scope.getPath = function (path) {

if (!!path && path.length > 0) {
var paths = path.split('/');

for (var i in paths) {
// Return to top-level when previous path contains route variables.
if (paths[i][0] === ':') {
paths = [];
break;
}
}

return paths.join('/');
}

return path;
};

// This is actually a URL path and not a route.
$scope.lastRoute = $scope.getPath(AccessControlService.getLastRoutePath());

});

0 comments on commit b9cf28b

Please sign in to comment.