Fix external auth message showing up when its disabled

This commit is contained in:
jvyden 2021-11-24 19:44:28 -05:00
commit 8edc276767
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -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")]