Hi,
Perhaps this is a silly question or is already answered somwhere in the docs but i cant seem to find how to change the default ui/login or ui/error routes to some other value (account/login)?
Thank you
Those are all under the control of the host. In the sample, that's controlled by the CustomViewLocationExpander.
The CustomViewLocationExpander lets you change the location of the views within the project, how can we go about changing the url that is in Constants.RoutePaths.Error. Currently whenever I get an error I still get redirected to http://localhost/ui/error (rather than http://localhost:55134/customerrorurl)
I can be wrong, but today they are constants https://github.com/IdentityServer/IdentityServer4/blob/4831ba4c46d545b4574ed04aef54a6b45eaef551/src/IdentityServer4/Constants.cs#L331
Is there any plans to make this customisable?
Yep.
Meanwhile you can use more than one Route Attribute on your Login/Error actions as follows:
[Route("ui/error", Name = "Error")]
[Route("home/error", Name = "HomeError")]
public async Task<IActionResult> Index(string errorId)
{
var vm = new ErrorViewModel();
if (errorId != null)
{
var message = await _interaction.GetErrorContextAsync(errorId);
if (message != null)
{
vm.Error = message;
}
}
return View("Error", vm);
}
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Yep.