Skip to content

Commit b251845

Browse files
Merge pull request #378 from TechnologyEnhancedLearning/Develop/Features/TD-4111-elfh-authentication-errors-in-error-log-WebUI
TD-4111: Null exception will be inserted into DB for ClientID and Origin
2 parents 26d42b0 + 8ded142 commit b251845

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

LearningHub.Nhs.WebUI/Controllers/OpenAthensController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ public ActionResult Login(string returnUrl, bool invalidScope = false)
235235
return this.View();
236236
}
237237

238+
if (string.IsNullOrWhiteSpace(this.authConfig.ClientId) || string.IsNullOrWhiteSpace(this.Settings.LearningHubWebUiUrl))
239+
{
240+
throw new Exception("ClientId or origin are empty.");
241+
}
242+
238243
var authUri = OpenAthensOpenIdConnect.GetAuthServerUri(this.authConfig, this.Settings, returnUrl);
239244

240245
return this.Redirect(authUri.AbsoluteUri);

0 commit comments

Comments
 (0)