Skip to content

Commit

Permalink
fixed url to affadivit
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanpa-aot committed Apr 14, 2021
1 parent ae80aa0 commit 7a565f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions auth-web/src/components/auth/mixins/NextPageMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class NextPageMixin extends Vue {
switch (this.currentUser?.loginSource) {
case LoginSource.IDIR:
// if the user is staff redirect to staff dashboard
orgName = encodeURIComponent(this.currentAccountSettings?.label)
orgName = encodeURIComponent(btoa(this.currentAccountSettings?.label))
if (this.currentUser.roles.includes(Role.Staff)) {
return `/${Pages.SEARCH_BUSINESS}`
} else if (this.currentOrganization && this.currentOrganization.statusCode === AccountStatus.PENDING_INVITE_ACCEPT) {
Expand Down Expand Up @@ -87,7 +87,7 @@ export default class NextPageMixin extends Vue {
// for invited users , handle user profile
// Redirect to create team if no orgs
// Redirect to dashboard otherwise
orgName = encodeURIComponent(this.currentAccountSettings?.label)
orgName = encodeURIComponent(btoa(this.currentAccountSettings?.label))
if (!this.userProfile?.userTerms?.isTermsOfUseAccepted) {
nextStep = Pages.USER_PROFILE_TERMS
} else if (!this.currentOrganization && !this.currentMembership) {
Expand All @@ -108,7 +108,7 @@ export default class NextPageMixin extends Vue {
// Redirect to create team if no orgs
// Redirect to dashboard otherwise
let bceidNextStep = '/'
orgName = encodeURIComponent(this.currentAccountSettings?.label)
orgName = encodeURIComponent(btoa(this.currentAccountSettings?.label))
let invToken = ConfigHelper.getFromSession(SessionStorageKeys.InvitationToken)
if (invToken) {
bceidNextStep = `${Pages.CONFIRM_TOKEN}/${invToken}`
Expand Down
16 changes: 15 additions & 1 deletion auth-web/src/routes/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ function mapOrgDetails (route: any) {
}
}

function mapPendingDetails (route: any) {
let orgName = route.params.teamName
try {
orgName = window.atob(orgName)
} catch (e) {
// older invitations.Ignore.org name wont be base 64 for old invitations.
}

return {
teamName: orgName,
pendingAffidavit: route.params.pendingAffidavit
}
}

export function getRoutes (): RouteConfig[] {
const accountSettings = () => import(/* webpackChunkName: "account-settings" */ '../views/auth/AccountSettings.vue')
const accountInfo = () => import(/* webpackChunkName: "account-settings" */ '../components/auth/account-settings/account-info/AccountInfo.vue')
Expand Down Expand Up @@ -511,7 +525,7 @@ export function getRoutes (): RouteConfig[] {
path: '/pendingapproval/:teamName?/:pendingAffidavit?',
name: 'pendingapproval',
component: PendingApprovalView,
props: true,
props: mapPendingDetails,
meta: { requiresAuth: true, requiresProfile: true }
},
{
Expand Down

0 comments on commit 7a565f9

Please sign in to comment.