TheShopCritics2/TSC2/Components/Layout/MainLayout.razor.cs

38 lines
1.2 KiB
C#
Raw Permalink Normal View History

2024-08-05 17:13:29 +00:00
namespace TSC2.Components.Layout
{
public partial class MainLayout
{
public static readonly bool isDev = true;
2024-08-05 17:13:29 +00:00
public static string Greeting = "Hello, {}";
2024-08-08 17:17:41 +00:00
public string GoogleClientId = CSharp.Credentials.GoogleClientId;
public string GoogleClientSecret = CSharp.Credentials.GoogleClientSecret;
public string FacebookId = CSharp.Credentials.FacebookAppId;
public static string GoogleRedirect = "https://localhost:7282/signin-google";
public static string FacebookRedirect = "https://localhost:7282/signin-facebook";
2024-08-05 17:13:29 +00:00
public static Dictionary<string, string> Session = new Dictionary<string, string>();
public static bool isSignedIn = false;
2024-08-05 17:13:29 +00:00
public static void UpdateGreeting()
{
if (Session.Count == 0)
{
return;
}
// This should only execute if the user is signed in AND is the first render
Greeting = "Hello, " + Session["name"];
}
2024-08-08 17:17:41 +00:00
public void SignOut()
{
Session = new Dictionary<string, string>();
isSignedIn = false;
2024-08-08 17:17:41 +00:00
_navigationManager.NavigateTo("/");
}
2024-08-05 17:13:29 +00:00
}
}