0

I am having an issue with query string. i send an activation link to email that link have a query string for example a user activation token. Her is an example of the link http://localhost:3000/#/activation?activation_code=27kVNlC4ShWuL4pkH3/FhVA==.However when i click on the link the browser automatically modify the query string to be http://localhost:3000/#/activation?activation_code=27kVNlC4ShWuL4pkH3%2FhVAwhich results in encryption error. Any idea how i can get the actual query string. i am using angular as front end and asp.net web API.

MohamedAbbas
  • 1,149
  • 4
  • 15
  • 31

3 Answers3

1

The activation code you are embedding in your url is using reserved characters. See this question: What is a valid URL query string?

I would suggest you url encode the activation token before appending it to the url.

Community
  • 1
  • 1
Matt Caton
  • 3,473
  • 23
  • 25
1

You need to URL encode your token. It's using reserved characters.

Don't forget to use encodeURIComponent() to encode all special characters.

Pak
  • 2,123
  • 22
  • 28
0

You can use this:

Server.UrlDecode(activation_code)
Chris Forrence
  • 10,042
  • 11
  • 48
  • 64
msnfreaky
  • 1,013
  • 10
  • 14