Refactored some code.

This commit is contained in:
Jeremy-Z 2026-06-08 11:24:05 -04:00
parent bd2dc84e6b
commit 5e686581db

View file

@ -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>