35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
namespace TSC2.Components.Layout
|
|
{
|
|
public partial class MainLayout
|
|
{
|
|
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 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>();
|
|
_navigationManager.NavigateTo("/");
|
|
}
|
|
}
|
|
}
|