mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-06-01 13:42:28 +00:00
Separate EULA and announce endpoints by purpose
Also fixes LBP3 login not showing anything
This commit is contained in:
parent
6a787bd1dd
commit
79be3e175b
2 changed files with 12 additions and 5 deletions
|
@ -28,16 +28,20 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
? this.StatusCode(403, "")
|
||||
: this.Ok
|
||||
(
|
||||
$"You are now logged in as user {user.Username} (id {user.UserId}).\n" +
|
||||
// ReSharper disable once UnreachableCode
|
||||
(EulaHelper.ShowPrivateInstanceNotice ? "\n" + EulaHelper.PrivateInstanceNotice : "") +
|
||||
EulaHelper.PrivateInstanceNoticeOrBlank +
|
||||
"\n" +
|
||||
$"{EulaHelper.License}\n"
|
||||
);
|
||||
}
|
||||
|
||||
[HttpGet("announce")]
|
||||
public IActionResult Announce() => this.Ok("");
|
||||
public async Task<IActionResult> Announce()
|
||||
{
|
||||
User user = await this.database.UserFromRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
|
||||
return this.Ok($"You are now logged in as user {user.Username} (id {user.UserId}).\n\n" + EulaHelper.PrivateInstanceNoticeOrBlank);
|
||||
}
|
||||
|
||||
[HttpGet("notification")]
|
||||
public IActionResult Notification() => this.Ok();
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.";
|
|||
public const string PrivateInstanceNotice = @"This server is a private testing instance.
|
||||
Please do not make anything public for now, and keep in mind security isn't as tight as a full release would.";
|
||||
|
||||
public const bool ShowPrivateInstanceNotice = false;
|
||||
// ReSharper disable once UnreachableCode
|
||||
public const string PrivateInstanceNoticeOrBlank = ShowPrivateInstanceNotice ? PrivateInstanceNotice : "";
|
||||
|
||||
public const bool ShowPrivateInstanceNotice = true;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue