I'm currently trying to retrieve the email from an encoded url similar to this:
I tried decodeURI like this:
const str = 'https://www.madeupwebsite.com/state=%7B%22application%22:%22SOMETHING%22,%22email%22:%22SOMETHING@madeup.com%22,%22subdomain%22:%22YES%22%7D';
const result = decodeURI(str);
but console.log returns this:
"https://www.madeupwebsite.com/state={\"application\":\"SOMETHING\",\"email\":\"SOMETHING@madeup.com\",\"subdomain\":\"YES\"}"
Is there a better way to get the email? Do I have to use regex?