Skip to content

Commit

Permalink
display information about current linking status in account maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
DeinFreund committed May 15, 2019
1 parent 81fa225 commit 08107ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Zero-K.info/Views/Shared/UserDetail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,14 @@
<h3 class="js_expand">Account maintenance</h3>
<div id="accountMaint" class="collapse width-90">
<h4>Link Discord Account</h4>
@if (Global.Account.DiscordID.HasValue)
{
<div>
Your account is currently linked to Discord ID @(Global.Account.DiscordID).
</div><br />
}
<a href="@Global.Server.DiscordWebApi.GetAuthenticationURL(Global.AccountID)">Login with Discord</a> <br/>
<br />

<h4>Change password</h4>
@if (!string.IsNullOrEmpty(Model.PasswordBcrypt))
{
Expand Down Expand Up @@ -422,6 +428,7 @@
}
@if (Global.IsModerator && Global.AccountID == Model.AccountID)
{
<br />
<div class="admin">
<h3>Admin extras</h3>
<form action="@Url.Action("SetZklsMaxPlayers", "Admin")" method="post">
Expand Down
2 changes: 1 addition & 1 deletion ZkLobbyServer/DiscordWebApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task<bool> LinkAccount(string state, string code)
if (!userIds.TryGetValue(state, out accountId))
{
Trace.TraceWarning("Invalid state " + state);
return;
return false;
}

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

0 comments on commit 08107ca

Please sign in to comment.