From a8cda15372949545826f934fb597536244553e18 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 30 Apr 2017 17:55:21 -0400 Subject: [PATCH] add oauth errors to audit logs --- Project-Unite/Controllers/OAuth2Controller.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Project-Unite/Controllers/OAuth2Controller.cs b/Project-Unite/Controllers/OAuth2Controller.cs index e8641ae..aadadfd 100644 --- a/Project-Unite/Controllers/OAuth2Controller.cs +++ b/Project-Unite/Controllers/OAuth2Controller.cs @@ -86,8 +86,11 @@ public async Task Login(string appname, string appdesc, string ver return new HttpStatusCodeResult(403); } } - catch + catch(Exception ex) { + var db = new ApplicationDbContext(); + db.AuditLogs.Add(new Models.AuditLog("system", AuditLogLevel.Admin, "The following error occurred during an OAuth2 authentication.
" + ex.ToString())); + db.SaveChanges(); return new HttpStatusCodeResult(HttpStatusCode.BadRequest); }