You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.0 KiB
31 lines
1.0 KiB
/*
|
|
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
|
|
* See https://github.com/openiddict/openiddict-core for more information concerning
|
|
* the license and the contributors participating to this project.
|
|
*/
|
|
|
|
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using OpenIddict.Sandbox.AspNetCore.Client.ViewModels.Shared;
|
|
|
|
namespace OpenIddict.Sandbox.AspNetCore.Client;
|
|
|
|
public class ErrorController : Controller
|
|
{
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true), Route("~/error")]
|
|
public IActionResult Error()
|
|
{
|
|
// If the error originated from the OpenIddict client, render the error details.
|
|
var response = HttpContext.GetOpenIddictClientResponse();
|
|
if (response is not null)
|
|
{
|
|
return View(new ErrorViewModel
|
|
{
|
|
Error = response.Error,
|
|
ErrorDescription = response.ErrorDescription
|
|
});
|
|
}
|
|
|
|
return View(new ErrorViewModel());
|
|
}
|
|
}
|
|
|