Skip to content

Commit

Permalink
Improved: app generation link from home page (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Aug 7, 2024
1 parent 4d012d1 commit d626556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import {
import { useAuthStore } from '@/store/auth';
import { useRouter } from "vue-router";
import { goToOms } from '@hotwax/dxp-components'
import { isMaargLogin } from '@/util';
import { isMaargLogin, isMaargLoginRequired } from '@/util';
import { translate } from '@/i18n';
export default defineComponent({
Expand Down Expand Up @@ -135,7 +135,7 @@ export default defineComponent({
},
generateAppLink(app: any, appEnvironment = '') {
const oms = isMaargLogin(app.handle) ? this.authStore.getMaargOms : this.authStore.getOMS;
window.location.href = this.scheme + app.handle + appEnvironment + this.domain + (this.authStore.isAuthenticated ? `/login?oms=${oms.startsWith('http') ? isMaargLogin(app.handle) ? oms : oms.includes('/api') ? oms : `${oms}/api/` : oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}${isMaargLogin(app.handle) ? '&omsRedirectionUrl=' + this.authStore.getOMS : ''}` : '')
window.location.href = this.scheme + app.handle + appEnvironment + this.domain + (this.authStore.isAuthenticated ? `/login?oms=${oms.startsWith('http') ? isMaargLogin(app.handle) ? oms : oms.includes('/api') ? oms : `${oms}/api/` : oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}${isMaargLogin(app.handle) ? '&omsRedirectionUrl=' + this.authStore.getOMS : isMaargLoginRequired(app.handle) ? '&omsRedirectionUrl=' + this.authStore.getMaargOms : ''}` : '')
}
},
setup() {
Expand Down Expand Up @@ -232,6 +232,7 @@ export default defineComponent({
domain,
goToOms,
isMaargLogin,
isMaargLoginRequired,
lockClosedOutline,
hardwareChipOutline,
openOutline,
Expand Down
1 change: 1 addition & 0 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export default defineComponent({
this.router.push("/")
return;
}
omsRedirectionUrl = this.authStore.oms
}
if(isMaargLoginRequired(this.authStore.getRedirectUrl) && this.authStore.getMaargOms) {
Expand Down

0 comments on commit d626556

Please sign in to comment.