Skip to content

Commit

Permalink
fix set auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Werzet committed Dec 17, 2024
1 parent 5bcd4f5 commit da87557
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Content.Server/SS220/Discord/DiscordPlayerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public sealed class DiscordPlayerManager : IPostInjectInit, IDisposable

private string _apiUrl = string.Empty;
private bool _isDiscordAuthEnabled = false;
private string _apiKey = string.Empty;

private string _linkApiUrl = string.Empty;
private bool _isDiscordLinkRequired = false;
Expand All @@ -59,19 +58,15 @@ public void Initialize()

_cfg.OnValueChanged(CCCVars.DiscordAuthApiUrl, v => _apiUrl = v, true);
_cfg.OnValueChanged(CCCVars.DiscordAuthEnabled, v => _isDiscordAuthEnabled = v, true);
_cfg.OnValueChanged(CCCVars.DiscordAuthApiKey, v => _apiKey = v,
//{
// _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", v);
//},
_cfg.OnValueChanged(CCCVars.DiscordAuthApiKey, v =>
{
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", v);
},
true);

_cfg.OnValueChanged(CCVars220.DiscordLinkApiUrl, v => _linkApiUrl = v, true);
_cfg.OnValueChanged(CCVars220.DiscordLinkRequired, v => _isDiscordLinkRequired = v, true);
_cfg.OnValueChanged(CCVars220.DiscordLinkApiKey, v => _linkApiKey = v,
//{
// _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", v);
//},
true);
_cfg.OnValueChanged(CCVars220.DiscordLinkApiKey, v => _linkApiKey = v, true);

_statusRefreshTimer = new Timer(async _ =>
{
Expand Down

0 comments on commit da87557

Please sign in to comment.