awslabs / cognito-at-edge

Serverless authentication solution to protect your website or Amplify application
Apache License 2.0
168 stars 54 forks source link

Double Decoding of the QueryParams #23

Closed AbhiPartha closed 2 years ago

AbhiPartha commented 2 years ago

What happened:

The code double decodes the query params resulting in malformed queryParam or altered queryParam.

What did you expect to have happen:

The queryParam to be return as such it was called.

How to reproduce this (as precisely and succinctly as possible):

Simply use the library and call with encoded queryParam and see the double decoding happening.

Anything else you think we should know?

The fix is in https://github.com/awslabs/cognito-at-edge/blob/main/index.js#L180 Removing the extra decoding might solve the issue.

Environment:

jeandek commented 2 years ago

Hi @AbhiPartha ,

Thanks for opening this issue and submitting a PR. I'm currently testing it and I'm observing some unexpected encoding differences between my test setup and another environment which uses the package. I'll keep you updated.

jeandek commented 2 years ago

Merged and will be included in the next release.