enabled auth in index
This commit is contained in:
Родитель
6030554532
Коммит
06d2442faa
|
@ -1,4 +1,5 @@
|
|||
@using RPSLS.Game.Shared
|
||||
@using RPSLS.Game.Shared.Config
|
||||
|
||||
@if (MultiplayerSettings.Enabled)
|
||||
{
|
||||
<div class="leaderboard-link">
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
@using Microsoft.Extensions.Options
|
||||
@using RPSLS.Game.Shared
|
||||
@using RPSLS.Game.Shared.Models
|
||||
@layout MainLayout
|
||||
@page "/"
|
||||
@*
|
||||
@inject IOptions<TwitterOptions> TwitterOptions
|
||||
*@
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject HttpClient httpClient
|
||||
@inject IOptions<MultiplayerSettings> MultiplayerSettings
|
||||
@inject IOptions<TwitterSettings> TwitterSettings
|
||||
|
||||
<div class="index-content">
|
||||
<div class="login">
|
||||
|
@ -37,10 +33,10 @@
|
|||
<input @bind-value="@CustomUsername" @bind-value:event="oninput" class="user" type="text" placeholder="Type Username" required />
|
||||
|
||||
<div class="sign_twitter">
|
||||
@*@if (!string.IsNullOrWhiteSpace(TwitterOptions?.Value?.ConsumerKey) && !string.IsNullOrWhiteSpace(TwitterOptions?.Value?.ConsumerSecret))
|
||||
{
|
||||
@if (TwitterSettings.Value.IsLoginEnabled)
|
||||
{
|
||||
<span>or <a href="/api/account/login/twitter">Sign in with Twitter</a></span>
|
||||
}*@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
@using Microsoft.JSInterop
|
||||
@using RPSLS.Game.Client
|
||||
@using RPSLS.Game.Client.Shared
|
||||
@using RPSLS.Game.Shared.Config
|
||||
@using RPSLS.Game.Shared.Models
|
||||
@using Microsoft.Extensions.Options
|
|
@ -2,7 +2,7 @@
|
|||
using GameApi.Proto;
|
||||
using Grpc.Net.Client;
|
||||
using Microsoft.Extensions.Options;
|
||||
using RPSLS.Game.Shared;
|
||||
using RPSLS.Game.Shared.Config;
|
||||
|
||||
namespace RPSLS.Game.Server.Clients
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
using RPSLS.Game.Shared;
|
||||
using RPSLS.Game.Shared.Config;
|
||||
|
||||
namespace RPSLS.Game.Server.Clients
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using Microsoft.Extensions.Options;
|
||||
using RPSLS.Game.Server.Clients;
|
||||
using RPSLS.Game.Shared;
|
||||
using RPSLS.Game.Shared.Config;
|
||||
|
||||
namespace RPSLS.Game.Server.Config
|
||||
{
|
||||
|
|
|
@ -63,8 +63,8 @@ namespace RPSLS.Game.Server.Controllers
|
|||
{
|
||||
userInfo = new UserInfo
|
||||
{
|
||||
Username = User?.Identity?.Name ?? string.Empty,
|
||||
IsTwitterUser = User.Identity?.AuthenticationType == TwitterDefaults.AuthenticationScheme
|
||||
Username = User.Identity.Name ?? string.Empty,
|
||||
IsTwitterUser = User.Identity.AuthenticationType == TwitterDefaults.AuthenticationScheme
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace RPSLS.Game.Shared
|
||||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class GameManagerSettings
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace RPSLS.Game.Shared
|
||||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class GameSettingsDto
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace RPSLS.Game.Shared
|
||||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class GoogleAnalyticsSettings
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace RPSLS.Game.Shared
|
||||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class GrpcSettings
|
||||
{
|
|
@ -0,0 +1,7 @@
|
|||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class MultiplayerSettings
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
namespace RPSLS.Game.Shared
|
||||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class RecognitionSettings
|
||||
{
|
|
@ -0,0 +1,7 @@
|
|||
namespace RPSLS.Game.Shared.Config
|
||||
{
|
||||
public class TwitterSettings
|
||||
{
|
||||
public bool IsLoginEnabled { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
namespace RPSLS.Game.Shared
|
||||
{
|
||||
public class MultiplayerSettings
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче