Refactored some code.
This commit is contained in:
parent
bd2dc84e6b
commit
5e686581db
1 changed files with 8 additions and 5 deletions
|
|
@ -136,12 +136,16 @@ export default {
|
||||||
if (resp.authentication.startsWith('RSAToken')) {
|
if (resp.authentication.startsWith('RSAToken')) {
|
||||||
const { token, signature } = queryStringParams;
|
const { token, signature } = queryStringParams;
|
||||||
const vsigResp = await validateISSClientSignature(clientTag, token, signature);
|
const vsigResp = await validateISSClientSignature(clientTag, token, signature);
|
||||||
|
|
||||||
|
// Encrypted params only populated if the authentication type includes EncParams and we have a pattern to pull them out of the decrypted data.
|
||||||
|
// Try/Catch is here to ensure that any issues with populating these parameters does not impact the overall authentication/authorization of the client.
|
||||||
|
// They can fallback to manually entering the data on the webpage.
|
||||||
if (resp.authentication.includes('EncParams') && encryptedParametersPattern) {
|
if (resp.authentication.includes('EncParams') && encryptedParametersPattern) {
|
||||||
try {
|
try {
|
||||||
const match = vsigResp.decryptedData.match(encryptedParametersPattern);
|
const encryptedParametersPatternRegex = RegExp(encryptedParametersPattern);
|
||||||
|
const match = vsigResp.decryptedData.match(encryptedParametersPatternRegex);
|
||||||
|
|
||||||
if ( match ) {
|
if ( match?.groups ) {
|
||||||
const params = match.groups;
|
const params = match.groups;
|
||||||
for (const [key, value] of Object.entries(params)) {
|
for (const [key, value] of Object.entries(params)) {
|
||||||
decryptedParams[key.toLowerCase()] = value;
|
decryptedParams[key.toLowerCase()] = value;
|
||||||
|
|
@ -299,9 +303,8 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue