From 8edc276767e0029359c03f8fe57600b1c74c72bb Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 24 Nov 2021 19:44:28 -0500 Subject: [PATCH] Fix external auth message showing up when its disabled --- .../Controllers/MessageController.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ProjectLighthouse/Controllers/MessageController.cs b/ProjectLighthouse/Controllers/MessageController.cs index aff3ddd6..33a23f4e 100644 --- a/ProjectLighthouse/Controllers/MessageController.cs +++ b/ProjectLighthouse/Controllers/MessageController.cs @@ -30,14 +30,19 @@ namespace LBPUnion.ProjectLighthouse.Controllers User user = await this.database.UserFromGameRequest(this.Request, true); if (user == null) return this.StatusCode(403, ""); - return this.Ok - ( - $"Please stay on this screen.\n" + - $"Before continuing, you must approve this session at {ServerSettings.Instance.ExternalUrl}.\n" + - $"Please keep in mind that if the session is denied you may have to wait up to 5-10 minutes to try logging in again.\n" + - $"Once approved, you may press X and continue.\n\n" + - ServerSettings.Instance.EulaText - ); + if (ServerSettings.Instance.UseExternalAuth) + { + return this.Ok + ( + $"Please stay on this screen.\n" + + $"Before continuing, you must approve this session at {ServerSettings.Instance.ExternalUrl}.\n" + + $"Please keep in mind that if the session is denied you may have to wait up to 5-10 minutes to try logging in again.\n" + + $"Once approved, you may press X and continue.\n\n" + + ServerSettings.Instance.EulaText + ); + } + + return this.Ok($"You are now logged in as {user.Username} (id: {user.UserId}).\n\n" + ServerSettings.Instance.EulaText); } [HttpGet("notification")]