Skip to content

Commit

Permalink
Merge pull request #525 from AudiovisualMetadataPlatform/AMP-3273_route
Browse files Browse the repository at this point in the history
Amp 3273 route
  • Loading branch information
yingfeng-iu authored Jul 3, 2024
2 parents 93a7bb5 + 9af6077 commit 726b189
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/shared/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
<div class="modal-footer my-modal-footer">
<slot name="footer">
<button type="button" class="btn btn-info" @click="close()">
<button type="button" class="btn btn-primary" @click="close()">
Close
</button>
</slot>
Expand Down
10 changes: 6 additions & 4 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ var router = new Router({
},
{
path: "/mgm-evaluation/:mgmCategoryId",
name: "mgm-evaluation",
name: "mgm-evaluation-category",
component: MGMevaluation,
meta: {
authorize: {
Expand All @@ -212,7 +212,7 @@ var router = new Router({
},
{
path: "/mgm-evaluation/:mgmCategoryId/:testResultIds",
name: "mgm-evaluation",
name: "mgm-evaluation-test-result",
component: TestResultsVisualiz,
meta: {
authorize: {
Expand Down Expand Up @@ -456,6 +456,7 @@ router.beforeEach(async (to, from, next) => {
const currentUser = accountService.currentUserValue;

console.log("from: ", from, "\nto: ", to, "\nnext: ", next);
console.log("currentUser: ", currentUser);

if (env.getDisableAuth() == "true" || !authorize) {
console.log("router: No auth needed.")
Expand All @@ -465,8 +466,9 @@ router.beforeEach(async (to, from, next) => {
// not logged in so redirect to access-denied page with login link and with the return url
return router.push({ path: "/access-denied", query: { returnUrl: to.path }});
} else {
// TODO, below API call is to validate auth token, in case the locally stored one is compromised;
// there might be better way to achieve this without making such extra API call
// TODO
// below API call is to validate the auth token before new page is loaded, in case the current login has expired;
// there should be better way to achieve this without making such extra API call
var success = await accountService.validate();
if (!success) {
// return next();
Expand Down

0 comments on commit 726b189

Please sign in to comment.