Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amp 3273 route #525

Merged
merged 2 commits into from
Jul 3, 2024
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
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
Loading