Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Check decrypted authToken for illegal characters
Browse files Browse the repository at this point in the history
  • Loading branch information
osaton committed Dec 19, 2016
1 parent 316695a commit dc540b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion StudioHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ class StudioHelper {
*/
_getDecryptedData(data) {
let decryptedData = null;
let decrypted = false;

try {
for (let key in data) {
Expand All @@ -570,11 +571,16 @@ class StudioHelper {
}

decryptedData[key] = this.cryptr.decrypt(data[key]);

// Test that authToken is formatted correctly
if (key === 'authToken' && /^[\w:\-]+$/.test(decryptedData[key])) {
decrypted = true;
}
}
}
} catch (e) {}

return decryptedData;
return decrypted ? decryptedData : null;
}

/**
Expand Down

0 comments on commit dc540b9

Please sign in to comment.