1

Like in title I am trying to set long string which is a token which I generate in my asp.net core web api to reset a password. It how it looks

'CfDJ8B6FVg53lAlFsw2pAgHLWhiy6LSLX+4rxJWBeeJBT9UOIt+zmYiQ7sbkPq3S0U8LEFIDgVLlOHMBhlWvUc0xhgVbkL0a/wGyd/eAVTpawnjWm/dKmrpvkgN7eJsDbFDA37zmdKr9hciHV/+0zMVxGqsV/G9tsMeyh1id4NGWP0iNg696jvEcAlylSwhs0d0NJTsYycscwRx6TpNGZIfgwuAjoGz9E5ymoh1ST1zERVHSuaWQzm4kFR5s5DCQdMfBIQ==

It is how i have define this route

    {path:"resetPasswordForm/:code", component: ResetPasswordFormComponent}

It match such url

http://localhost:4200/#/resetPasswordForm/1 or http://localhost:4200/#/resetPasswordForm/sdfsdhfbjsbshdfbjsdf

but not such complicated string as my token is.

Stefan
  • 1,431
  • 2
  • 17
  • 33
  • Yap because your token have back slashes which makes the router thing that it is a new param also the HTTP GET method has a size for query params makes sure your param does not overpass it as well. – Sadok Mtir Sep 18 '17 at 15:39
  • Ok is there any way to get around this? – Stefan Sep 18 '17 at 15:40
  • use querystring params – Sonicd300 Sep 18 '17 at 15:41
  • 1
    For the first problem I think the best way is to use query param and for the second problem if you overpass the size you need to change from GET to POST. – Sadok Mtir Sep 18 '17 at 15:42
  • Ok how i should implement it if i get such url which should redirect me to from at my client side > http://localhost:4200/#/resetPasswordForm/'CfDJ8B6FVg53lAlFsw2pAgHLWhiy6LSLX+4rxJWBeeJBT9UOIt+zmYiQ7sbkPq3S0U8LEFIDgVLlOHMBhlWvUc0xhgVbkL0a/wGyd/eAVTpawnjWm/dKmrpvkgN7eJsDbFDA37zmdKr9hciHV/+0zMVxGqsV/G9tsMeyh1id4NGWP0iNg696jvEcAlylSwhs0d0NJTsYycscwRx6TpNGZIfgwuAjoGz9E5ymoh1ST1zERVHSuaWQzm4kFR5s5DCQdMfBIQ==' – Stefan Sep 18 '17 at 15:44

1 Answers1

1

In angular application URL, there is a limit in the length. You cannot append everything into the url

I got this Url limit error while passing some data as query string in the url. Then I have to limit the url and stored data in local store and pick that in the next page. You can do that in case its possible in your case.

you see more detail here

Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132