From ca73f1c6e08cb05c2a0221df1f214d704a7bb032 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Sat, 26 Jul 2025 09:44:56 -0700 Subject: [PATCH] Notify and crash before its a problem --- src/Server/Controllers/MAuth.cs | 4 ++-- src/Server/Services/AuthJWT.cs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Server/Controllers/MAuth.cs b/src/Server/Controllers/MAuth.cs index 8b35b70..c43359d 100644 --- a/src/Server/Controllers/MAuth.cs +++ b/src/Server/Controllers/MAuth.cs @@ -52,7 +52,7 @@ namespace Auth.Controllers { return BadRequest("Account Not Found"); } catch (Exception ex) { Console.WriteLine("Login Error: " + ex.Message); - return BadRequest("An internal server error has occured: " + ex.Message); + return BadRequest("An internal server error has occured"); } } @@ -72,7 +72,7 @@ namespace Auth.Controllers { } return BadRequest("The session ticket cannot be found"); } catch (Exception ex) { - Console.WriteLine("Delete Error: " + ex.Message); + Console.WriteLine("Token Error: " + ex.Message); return BadRequest("An internal server error has occured"); } } diff --git a/src/Server/Services/AuthJWT.cs b/src/Server/Services/AuthJWT.cs index 54e7e0f..8024c55 100644 --- a/src/Server/Services/AuthJWT.cs +++ b/src/Server/Services/AuthJWT.cs @@ -58,6 +58,11 @@ namespace Auth.Services { } public static RsaSecurityKey LoadRSAKey(string KeyPath) { + if (!File.Exists(KeyPath)) { + Console.WriteLine("Unable to load certificate from path: " + KeyPath); + Console.WriteLine("---- Shutting down ----"); + Environment.Exit(100); + } string KeyText = File.ReadAllText(KeyPath); RSA rsa = RSA.Create(); rsa.ImportFromPem(KeyText.ToCharArray());