Skip to content

Commit 08107ca

Browse files
committed
display information about current linking status in account maintenance
1 parent 81fa225 commit 08107ca

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Zero-K.info/Views/Shared/UserDetail.cshtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,14 @@
392392
<h3 class="js_expand">Account maintenance</h3>
393393
<div id="accountMaint" class="collapse width-90">
394394
<h4>Link Discord Account</h4>
395+
@if (Global.Account.DiscordID.HasValue)
396+
{
397+
<div>
398+
Your account is currently linked to Discord ID @(Global.Account.DiscordID).
399+
</div><br />
400+
}
395401
<a href="@Global.Server.DiscordWebApi.GetAuthenticationURL(Global.AccountID)">Login with Discord</a> <br/>
396-
<br />
402+
397403
<h4>Change password</h4>
398404
@if (!string.IsNullOrEmpty(Model.PasswordBcrypt))
399405
{
@@ -422,6 +428,7 @@
422428
}
423429
@if (Global.IsModerator && Global.AccountID == Model.AccountID)
424430
{
431+
<br />
425432
<div class="admin">
426433
<h3>Admin extras</h3>
427434
<form action="@Url.Action("SetZklsMaxPlayers", "Admin")" method="post">

ZkLobbyServer/DiscordWebApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public async Task<bool> LinkAccount(string state, string code)
5252
if (!userIds.TryGetValue(state, out accountId))
5353
{
5454
Trace.TraceWarning("Invalid state " + state);
55-
return;
55+
return false;
5656
}
5757

5858
var request = new HttpRequestMessage(HttpMethod.Post, "https://discordapp.com/api/oauth2/token");

0 commit comments

Comments
 (0)