From 855fcbc7e19690f74a814773fe43f1d83109ff36 Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Sun, 22 May 2022 19:30:55 -0700 Subject: [PATCH] Fixed invalid ViewBag title assignment --- IdentityServer/Controllers/AccountController.cs | 2 +- IdentityServer/Controllers/ErrorController.cs | 4 ++-- Teknik/Areas/Error/Controllers/ErrorController.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IdentityServer/Controllers/AccountController.cs b/IdentityServer/Controllers/AccountController.cs index 7bf4933..d1f0e09 100644 --- a/IdentityServer/Controllers/AccountController.cs +++ b/IdentityServer/Controllers/AccountController.cs @@ -60,7 +60,7 @@ namespace Teknik.IdentityServer.Controllers [HttpGet] public async Task Login(string returnUrl) { - ViewBag.Title = $"Sign in"; + ViewBag.Title = "Sign in"; // build a model so we know what to show on the login page var vm = await _account.BuildLoginViewModelAsync(returnUrl); diff --git a/IdentityServer/Controllers/ErrorController.cs b/IdentityServer/Controllers/ErrorController.cs index 7a6ccc3..23424a0 100644 --- a/IdentityServer/Controllers/ErrorController.cs +++ b/IdentityServer/Controllers/ErrorController.cs @@ -153,10 +153,10 @@ namespace Teknik.IdentityServer.Controllers ViewBag.Title = "Identity Error"; ViewBag.Description = "The Identity Service threw an error"; - LogError(LogLevel.Error, "Identity Error: " + message.Error); + LogError(LogLevel.Error, "Identity Error: " + message?.Error); IdentityErrorViewModel model = new IdentityErrorViewModel(); - model.Title = message.Error; + model.Title = message?.Error; model.Description = message.ErrorDescription; return GenerateActionResult(CreateErrorObj("Http", StatusCodes.Status500InternalServerError, message.Error), View("~/Views/Error/IdentityError.cshtml", model)); diff --git a/Teknik/Areas/Error/Controllers/ErrorController.cs b/Teknik/Areas/Error/Controllers/ErrorController.cs index 5e801d6..dcd4d86 100644 --- a/Teknik/Areas/Error/Controllers/ErrorController.cs +++ b/Teknik/Areas/Error/Controllers/ErrorController.cs @@ -57,7 +57,7 @@ namespace Teknik.Areas.Error.Controllers [TrackPageView] public IActionResult HttpGeneral(int statusCode) { - ViewBag.Title = statusCode; + ViewBag.Title = statusCode.ToString(); LogError(LogLevel.Error, "HTTP Error Code: " + statusCode);