Rename
Explore posts from serversBad Request for URL containing token route on server
I have this endpoint:
[HttpGet("setup-account/{token}")]
public IActionResult SetupAccountPassword([FromRoute] string token, [FromQuery] string email)
{
//manually decode because route parameters do not get automatically decoded.
token = Base64UrlEncoder.Decode(token);
return View("ResetPassword", new ResetPasswordViewModel(email, token));
}
I open it from an email link such as:
https://localhost:5001/auth/setup-account/Q2ZESjhDT3ZWdEtLK0FSSHBaV09tNG5Lem1wTXpWcjF0MmV5ZWF5Z1ZYZkNsS3licVBFV3k5VlFOc2I2VEN5TmF5anNLV0hyck15eEpNb21zMis1cG9UME1FUkw4V2hwWFVXRVlWcnkrNlhzYUoyK0QwcW1mdzNJUHNERlFaR3FjRWxzQ2loamVBTEpTM1ZLWHROaTVDd2l0djRGTGdvc013SHFOMWQveFBLREVoNDNGQ3pPV1plcXlEa2ZydjBWRjkyNjl3PT0?email=test@icloud.com
this link works properly on localhost but it doesn't once I publish the website to a server and access it from the domain, in that case I get 400 Bad Request error Invalid URL
any idea?
73 replies