OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 56 forks source link

Modified regex in extractParams to ignore leading frontslash #91

Open Seebiscuit opened 6 years ago

Seebiscuit commented 6 years ago

This PR relates to #90. Please, refer to that issue for the motivation.

As explained in that PR the regex used in src/authentication/authenticator.ts:125 was modified from

/([^&=]+)=([^&]*)/g

to

/[\/]?([^&=]+)=([^&]*)/g

to ignore front-slashes. Also, that removes to perform the following check:

      // Fixes bugs when the state parameters contains a / before them
      if (matchParts[1] === '/state') {
        matchParts[1] = matchParts[1].replace('/', '');
      }

So those lines were removed.

PS, I think Prettier buggered your current formatting. I'm very sorry. I didn't want to do a global replace in case I messed something else up. Please, let me know what formatter you're using and I'l try to clean that up.

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

Seebiscuit commented 6 years ago

I have tested in a current project.

WrathOfZombies commented 6 years ago

@casieber Can you take a look at this?

Seebiscuit commented 6 years ago

@WrathOfZombies, @casieber any chance this can get merged? I know everyone's busy, but I'd be happy to help any way I can.

Seebiscuit commented 4 years ago

Hey, @WrathOfZombies, @Zlatkovsky , or any other admin, I can no longer maintain this PR. Feel free to assign someone else to it or close it.