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

37 lines
1.2 KiB
C#
Raw Normal View History

2024-08-05 17:13:29 +00:00
namespace TSC2.Components.Layout
{
public partial class MainLayout
{
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 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"];
Console.Out.WriteLine("Updated greeting");
}
2024-08-08 17:17:41 +00:00
public void SignOut()
{
Session = new Dictionary<string, string>();
_navigationManager.NavigateTo("/");
Console.WriteLine("Signed out");
}
2024-08-05 17:13:29 +00:00
}
}