diff --git a/src/app-simplefin/app-simplefin.js b/src/app-simplefin/app-simplefin.js index 7c123166f..27760987a 100644 --- a/src/app-simplefin/app-simplefin.js +++ b/src/app-simplefin/app-simplefin.js @@ -266,6 +266,10 @@ function parseAccessKey(accessKey) { let username = null; let password = null; let baseUrl = null; + if (!accessKey || !accessKey.match(/^.*\/\/.*:.*@.*$/)) { + console.log(`Invalid SimpleFIN access key: ${accessKey}`); + throw new Error(`Invalid access key`); + } [scheme, rest] = accessKey.split('//'); [auth, rest] = rest.split('@'); [username, password] = auth.split(':'); diff --git a/upcoming-release-notes/485.md b/upcoming-release-notes/485.md new file mode 100644 index 000000000..3fd1ff078 --- /dev/null +++ b/upcoming-release-notes/485.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [psybers] +--- + +Check if SimpleFIN accessKey is in the correct format.