Skip to content

Commit

Permalink
15740 - Fix for url decode #2 (#2486)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jxio authored Aug 23, 2023
1 parent 031d5a3 commit 5a6b39b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ export default class EntityManagement extends Mixins(AccountMixin, AccountChange
this.setup()
if (this.base64Token && this.base64OrgName) {
const decodedToken = Base64.decode(this.base64Token) // Decode the Base64 token
const decodedToken = Base64.decode(this.base64Token)
const token = JSON.parse(decodedToken)
const legalName = Base64.decode(this.base64OrgName)
this.parseUrlAndAddAffiliation(token, legalName)
Expand Down
12 changes: 7 additions & 5 deletions auth-web/src/routes/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,20 @@ export function getRoutes (): RouteConfig[] {
]
},
{
path: '/:base64OrgName/affiliationInvitation/acceptToken//:base64Token',
path: '/:base64OrgName/affiliationInvitation/acceptToken/:base64Token',
name: 'account-magic-link',
component: EntityManagement,
props: route => {
try {
const base64Token = route.params.base64Token
const decodedToken = Base64.decode(base64Token) // Decode the Base64 token
const orgId = JSON.parse(decodedToken).fromOrgId // Extract the orgId from the decoded token
// The :base64Token consists of a token that is divided into three parts, separated by periods.
// we extract the first part of the token for decoding.
const base64Token = route.params.base64Token.split('.')[0]
const decodedToken = Base64.decode(base64Token)
const orgId = JSON.parse(decodedToken).fromOrgId

return {
orgId: orgId,
base64Token: route.params.base64Token,
base64Token: base64Token,
base64OrgName: route.params.base64OrgName
}
} catch (error) {
Expand Down

0 comments on commit 5a6b39b

Please sign in to comment.