38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
namespace TSC2.Components.Layout
|
|
{
|
|
public partial class MainLayout
|
|
{
|
|
public static readonly bool isDev = true;
|
|
|
|
public static string Greeting = "Hello, {}";
|
|
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";
|
|
public static Dictionary<string, string> Session = new Dictionary<string, string>();
|
|
public static bool isSignedIn = false;
|
|
|
|
|
|
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"];
|
|
}
|
|
|
|
|
|
|
|
public void SignOut()
|
|
{
|
|
Session = new Dictionary<string, string>();
|
|
isSignedIn = false;
|
|
_navigationManager.NavigateTo("/");
|
|
}
|
|
}
|
|
}
|